- Notifications
You must be signed in to change notification settings - Fork1.1k
fix: reduce impact of GetPrebuildMetrics on database#19694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -- Remove index on workspace_builds.initiator_id | ||
| DROP INDEX IF EXISTS idx_workspace_builds_initiator_id; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| -- Add index on workspace_builds.initiator_id to optimize prebuild queries | ||
| -- This will dramatically improve performance for: | ||
| -- - GetPrebuildMetrics (called every 15 seconds) | ||
cstyan marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| -- - Any other queries using workspace_prebuild_builds view | ||
| -- - Provisioner job queue prioritization | ||
| CREATE INDEX idx_workspace_builds_initiator_id ON workspace_builds (initiator_id); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -105,7 +105,7 @@ var ( | ||
| ) | ||
| const ( | ||
| metricsUpdateInterval = time.Second *60 | ||
| metricsUpdateTimeout = time.Second * 10 | ||
| ) | ||
Uh oh!
There was an error while loading.Please reload this page.