Skip to content

Commit

Permalink
fix: add index for GetProvisionerLogsByIDBetween (#5020)
Browse files Browse the repository at this point in the history
  • Loading branch information
coadler committed Nov 16, 2022
1 parent da758ba commit e7f1192
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
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

0 comments on commit e7f1192

Please sign in to comment.