Skip to content

Commit 353888a

Browse files
spikecurtiscoadler
authored andcommitted
feat: add src_id and dst_id indexes to tailnet_tunnels (#12911)
Fixes #12780 Adds indexes to the `tailnet_tunnels` table to speed up `GetTailnetTunnelPeerIDs` and `GetTailnetTunnelPeerBindings` queries, which match on `src_id` and `dst_id`. (cherry picked from commit a231b5a)
1 parent 3fc6111 commit 353888a

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)