Skip to content

Conversation

@virajmehta
Copy link
Member

@virajmehta virajmehta commented Jan 22, 2026

Note

Improves claim performance and reduces table scans.

  • Indexes: Adds r_*_ready (available_at, run_id) INCLUDE (task_id), w_*_ti (task_id), r_*_cei (claim_expires_at WHERE state='running'), t_*_cxlpol (task_id WHERE cancellation set with max_* ), and t_*_state_tid (state, task_id WHERE state in active/cancelled) into ensure_queue_tables.
  • claim_task: Narrows pre-claim cancellation sweep to only tasks with cancellation containing max_delay or max_duration.
  • Migration: Adds 20251205000000_add_claim_task_indexes.sql to redefine ensure_queue_tables and claim_task, and applies updated indexes/functions to all existing queues.

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

@virajmehta virajmehta changed the title Viraj/claim task index Improve indices for common queries Jan 22, 2026
@virajmehta virajmehta enabled auto-merge January 22, 2026 17:11
@virajmehta virajmehta added this pull request to the merge queue Jan 22, 2026
Merged via the queue into main with commit 3a06598 Jan 22, 2026
2 checks 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