Skip to content

Add indexes for non-primary-key job queries#777

Merged
f-f merged 1 commit into
masterfrom
issue-731-add-job-query-indexes
Jul 22, 2026
Merged

Add indexes for non-primary-key job queries#777
f-f merged 1 commit into
masterfrom
issue-731-add-job-query-indexes

Conversation

@thomashoneyman

@thomashoneyman thomashoneyman commented Jul 22, 2026

Copy link
Copy Markdown
Member

Closes #731 by adding indexes for the non primary-key queries used by job dupe detection and pending job selection:

  • publish_jobs (packageName, packageVersion)
  • unpublish_jobs (packageName, packageVersion)
  • transfer_jobs (packageName)
  • job_info (createdAt), restricted to pending jobs

I verified the migration against a fresh SQLite database, including rollback and re-application. EXPLAIN QUERY PLAN confirms that SQLite uses each new index for its corresponding query. The regenerated db/schema.sql matches dbmate’s generated schema.

@thomashoneyman
thomashoneyman requested a review from f-f July 22, 2026 00:42
Amp-Thread-ID: https://ampcode.com/threads/T-019f86f1-815e-70c5-bfc5-2e12ae6ba5d2

Co-authored-by: Thomas Honeyman <admin@thomashoneyman.com>
@f-f
f-f force-pushed the issue-731-add-job-query-indexes branch from 8a0d0f4 to a51afce Compare July 22, 2026 09:20
@f-f
f-f merged commit 45d7a1d into master Jul 22, 2026
7 checks passed
@f-f
f-f deleted the issue-731-add-job-query-indexes branch July 22, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add some indexes for the queries that don't use primary keys to select

2 participants