Content-Length: 295093 | pFad | http://github.com/coder/coder/commit/61a9f58e788d2d9e4d7737b01d24755cb3e43ab9

2C perf: optimize get-queue-position sql query · coder/coder@61a9f58 · GitHub
Skip to content

Commit 61a9f58

Browse files
perf: optimize get-queue-position sql query
1 parent f9c9711 commit 61a9f58

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

coderd/database/queries.sql.go

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/provisionerjobs.sql

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,20 @@ WHERE
5353
WITH filtered_provisioner_jobs AS (
5454
-- Step 1: Filter provisioner_jobs
5555
SELECT
56-
*
56+
id, created_at
5757
FROM
5858
provisioner_jobs
5959
WHERE
6060
id = ANY(@ids :: uuid [ ]) -- Apply filter early to reduce dataset size before expensive JOIN
6161
),
6262
pending_jobs AS (
6363
-- Step 2: Extract only pending jobs
64-
SELECT *
65-
FROM provisioner_jobs
66-
WHERE job_status = 'pending'
64+
SELECT
65+
id, created_at, tags
66+
FROM
67+
provisioner_jobs
68+
WHERE
69+
job_status = 'pending'
6770
),
6871
ranked_jobs AS (
6972
-- Step 3: Rank only pending jobs based on provisioner availability

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/coder/coder/commit/61a9f58e788d2d9e4d7737b01d24755cb3e43ab9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy