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

Skip to content

Commit a64e13f

Browse files
committed
fix(coderd/database): add fk index for workspace_agent_scripts
I noticed we were missing this index while looking at query performances, we were doing sequential scans on the table via the `GetWorkspaceAgentScriptsByAgentIDs` query, which is relatively fast whilst the table is small, but at 8.5k calls/hour in our dogfood instance, it will become problematic eventually.
1 parent d734f3f commit a64e13f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP INDEX workspace_agent_scripts_workspace_agent_id_idx;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE INDEX workspace_agent_scripts_workspace_agent_id_idx ON workspace_agent_scripts (workspace_agent_id);

0 commit comments

Comments
 (0)