Skip to content

fix: add missing db indexes for webhook queue, overdue sweep, and inv… - #539

Merged
Cedarich merged 1 commit into
ZyntariHQ:mainfrom
Rayyanah0:fix/499-add-missing-db-indexes
Aug 30, 2026
Merged

fix: add missing db indexes for webhook queue, overdue sweep, and inv…#539
Cedarich merged 1 commit into
ZyntariHQ:mainfrom
Rayyanah0:fix/499-add-missing-db-indexes

Conversation

@Rayyanah0

Copy link
Copy Markdown
Contributor

closes #499
Add composite indexes supporting the hot queries:

  • webhook_deliveries(status, next_attempt_at) for the queue worker polling pending deliveries due for retry
  • invoices(status, due_date) for the daily overdue sweep
  • invoices(merchant_id, is_draft, status, created_at) for the merchant invoice list/dashboard filters ordered by creation date

Summary

Provide a clear summary of what this PR changes and why.

Related Issue(s)

Link any related issue(s) using #<issue-number>.
If this PR closes an issue, include Closes #<issue-number>.

Type of Change

  • Feature
  • Fix
  • Refactor
  • Documentation
  • Chore

Description

Describe the implementation details and scope of the changes.

Testing Evidence

Describe how this change was tested, including commands run or test cases executed.
Include links to test outputs, screenshots, or any relevant evidence.

Screenshots

Add screenshots, GIFs, or recordings when UI or visual behavior changed.

Checklist

  • Code builds successfully
  • Tests added/updated where applicable
  • Documentation updated if needed
  • Linked issue referenced
  • Ready for review

…oice lists

Add composite indexes supporting the hot queries:
- webhook_deliveries(status, next_attempt_at) for the queue worker polling
  pending deliveries due for retry
- invoices(status, due_date) for the daily overdue sweep
- invoices(merchant_id, is_draft, status, created_at) for the merchant
  invoice list/dashboard filters ordered by creation date

@Cedarich Cedarich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cedarich
Cedarich merged commit 80b8357 into ZyntariHQ:main Aug 30, 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.

Add missing database indexes for the webhook queue, overdue sweep, and merchant invoice lists

2 participants