Skip to content

fix: add index for GetProvisionerLogsByIDBetween #5020

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: add index for GetProvisionerLogsByIDBetween
  • Loading branch information
coadler committed Nov 10, 2022
commit 453731ba0132fb680df906d6d10572744759b036
2 changes: 2 additions & 0 deletions coderd/database/dump.sql

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX provisioner_job_logs_id_job_id_idx;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX provisioner_job_logs_id_job_id_idx ON provisioner_job_logs USING btree (job_id, id ASC);
8 changes: 4 additions & 4 deletions coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion coderd/database/queries/provisionerjoblogs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WHERE
AND (
id > @created_after
OR id < @created_before
) ORDER BY id;
) ORDER BY id ASC;

-- name: InsertProvisionerJobLogs :many
INSERT INTO
Expand Down
6 changes: 3 additions & 3 deletions coderd/database/queries/provisionerjobs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ WHERE
AND nested.completed_at IS NULL
AND nested.provisioner = ANY(@types :: provisioner_type [ ])
ORDER BY
nested.created_at FOR
UPDATE
SKIP LOCKED
nested.created_at
FOR UPDATE
SKIP LOCKED
LIMIT
1
) RETURNING *;
Expand Down