mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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`.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
DROP INDEX idx_tailnet_tunnels_src_id;
|
||||
DROP INDEX idx_tailnet_tunnels_dst_id;
|
||||
@@ -0,0 +1,3 @@
|
||||
-- Since src_id and dst_id are UUIDs, we only ever compare them with equality, so hash is better
|
||||
CREATE INDEX idx_tailnet_tunnels_src_id ON tailnet_tunnels USING hash (src_id);
|
||||
CREATE INDEX idx_tailnet_tunnels_dst_id ON tailnet_tunnels USING hash (dst_id);
|
||||
Reference in New Issue
Block a user