Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9db265d

Browse files
authored
fix(coderd/database): optimize provisioner daemon with status query using index (#19703)
Fixescoder/internal#724This change adds an index to optimize the`GetProvisionerDaemonsWithStatusByOrganization` query.Execution time dropped from `18s 838ms` to `107ms`.
1 parent38028df commit9db265d

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

‎coderd/database/dump.sql‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROPINDEX provisioner_jobs_worker_id_organization_id_completed_at_idx;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CREATEINDEXprovisioner_jobs_worker_id_organization_id_completed_at_idxON provisioner_jobs (worker_id, organization_id, completed_atDESC NULLS FIRST);
2+
3+
COMMENT ON INDEX provisioner_jobs_worker_id_organization_id_completed_at_idx IS'Support index for finding the latest completed jobs for a worker (and organization), nulls first so that active jobs have priority; targets: GetProvisionerDaemonsWithStatusByOrganization';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp