Skip to content

Conversation

@virajmehta
Copy link
Member

@virajmehta virajmehta commented Jan 21, 2026

Also added infra for nicer migrations


Note

Improves claim_task performance and adds a migration to roll out new indexes across existing queues.

  • Adds targeted indexes in ensure_queue_tables: r_*_ready partial index on (available_at, run_id) include (task_id), w_*_ti on task_id, r_*_cei partial index on claim_expires_at for running runs, t_*_cxlpol partial index on task_id for tasks with cancellation policies, and t_*_state_tid composite index on (state, task_id)
  • Updates claim_task to only scan tasks that have cancellation policies when applying max_delay/max_duration cancellations
  • Introduces migration 20251205000000_add_claim_task_indexes.sql to CREATE OR REPLACE affected functions and apply indexes to existing queues via a DO block

Written by Cursor Bugbot for commit 0eee55a. This will update automatically on new commits. Configure here.

@virajmehta virajmehta changed the base branch from main to viraj/migration-infra January 22, 2026 13:38
@virajmehta virajmehta marked this pull request as ready for review January 22, 2026 16:40
@Aaron1011 Aaron1011 merged commit 74fb859 into viraj/migration-infra Jan 22, 2026
1 check passed
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.

3 participants