Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a231b5a

Browse files
authored
feat: add src_id and dst_id indexes to tailnet_tunnels (coder#12911)
Fixes coder#12780 Adds indexes to the `tailnet_tunnels` table to speed up `GetTailnetTunnelPeerIDs` and `GetTailnetTunnelPeerBindings` queries, which match on `src_id` and `dst_id`.
1 parent ab116af commit a231b5a

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

coderd/database/dump.sql

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DROP INDEX idx_tailnet_tunnels_src_id;
2+
DROP INDEX idx_tailnet_tunnels_dst_id;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- Since src_id and dst_id are UUIDs, we only ever compare them with equality, so hash is better
2+
CREATE INDEX idx_tailnet_tunnels_src_id ON tailnet_tunnels USING hash (src_id);
3+
CREATE INDEX idx_tailnet_tunnels_dst_id ON tailnet_tunnels USING hash (dst_id);

0 commit comments

Comments
 (0)