-
Notifications
You must be signed in to change notification settings - Fork 12
Indexing dashboard: generation column and spawn-aware prerender job links #5475
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
habdelra
merged 6 commits into
main
from
cs-12049-prerender-split-indexing-dashboard-generation-column-spawn
Jul 13, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
654d295
Indexing dashboard: generation column + spawn-aware prerender links
habdelra 929ccf6
Add PR preview images
habdelra 784a70e
Remove PR preview images
habdelra 9bbeb1d
Bound spawn correlation to 48h; pluralize prerender link titles
habdelra 1023013
Index the prerender spawn correlation instead of time-bounding it
habdelra c7ebeb4
Drop unused eslint-disable from index migration
habdelra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/postgres/migrations/1783724082538_add-jobs-prerender-spawning-job-id-index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // Partial expression index correlating a prerender_html job back to the | ||
| // indexing pass that spawned it (the spawningJobId its args carry). The | ||
| // Grafana indexing dashboard resolves a prerender_job_id per displayed | ||
| // indexing job through this expression, so each lookup is an index probe | ||
| // instead of a scan over all accumulated prerender_html jobs. The second | ||
| // key column lets a MAX(id)/ORDER BY id probe resolve newest-wins without | ||
| // touching the heap. | ||
| // | ||
| // The index expression must match the dashboard rawSql exactly — | ||
| // ((args->>'spawningJobId')::bigint) — or the planner will not use it. | ||
| // | ||
| // CONCURRENTLY avoids locking queue writes during the build in | ||
| // production; it cannot run inside a transaction, hence noTransaction(). | ||
|
|
||
| exports.shorthands = undefined; | ||
|
|
||
| exports.up = (pgm) => { | ||
| pgm.noTransaction(); | ||
| pgm.sql(` | ||
| CREATE INDEX CONCURRENTLY IF NOT EXISTS jobs_prerender_html_spawning_job_id_idx | ||
| ON jobs (((args->>'spawningJobId')::bigint), id) | ||
| WHERE job_type = 'prerender_html' | ||
| AND args->>'spawningJobId' IS NOT NULL; | ||
| `); | ||
| }; | ||
|
|
||
| exports.down = (pgm) => { | ||
| pgm.noTransaction(); | ||
| pgm.sql(` | ||
| DROP INDEX CONCURRENTLY IF EXISTS jobs_prerender_html_spawning_job_id_idx; | ||
| `); | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.