Skip to content

Conversation

spikecurtis
Copy link
Contributor

@spikecurtis spikecurtis commented Aug 20, 2025

relates to: coder/internal#718

Optimizes the GetTailnetTunnelPeerBindings query to reduce its execution time.

Before: https://explain.dalibo.com/plan/c2fd53f913aah21c

After: https://explain.dalibo.com/plan/6bc67d323g7afh61

At a high level, we first assemble the total list of peer IDs needed by the query, and only then go into the tailnet_peers table to extract their info. This saves us some time instead of hashing the entire tailnet_peers table.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@spikecurtis spikecurtis requested a review from Emyrk August 20, 2025 11:30
@spikecurtis spikecurtis marked this pull request as ready for review August 20, 2025 11:30
Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LG

@spikecurtis spikecurtis merged commit 229d051 into main Aug 21, 2025
38 checks passed
@spikecurtis spikecurtis deleted the spike/internal-718-get-tailnet-tunnel-peer-bindings branch August 21, 2025 05:53
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants