Skip to content

Commit 836370c

Browse files
committed
fix(coderd/database): add index on workspace_app_statuses.app_id
The queries GetWorkspaceAppStatusesByAppIDs and GetLatestWorkspaceAppStatusByAppID both filter by app_id but there was no index to support this, causing sequential scans. Refs https://www.notion.so/coderhq/2k-Task-Status-Updates-retest-2bfd579be59280ca8f86eb376d05e0fa
1 parent 6aeb144 commit 836370c

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

coderd/database/dump.sql

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP INDEX IF EXISTS workspace_app_statuses_app_id_idx;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE INDEX workspace_app_statuses_app_id_idx ON workspace_app_statuses (app_id);

0 commit comments

Comments
 (0)