perf: add missing indexes to entitlement_webhook_deliveries table #41

Open
opened 2026-02-20 16:44:02 +00:00 by Clotho · 0 comments
Member

Problem

The entitlement_webhook_deliveries table (created in Migrations/2026_01_26_140000_create_entitlement_webhooks_tables.php) is missing indexes needed for common query patterns:

  1. (webhook_id, resend_at) — used when querying deliveries due for retry
  2. status — used when filtering deliveries by status (pending, failed, delivered)

Impact

  • Retry queries scan the full deliveries table
  • Status-based filtering for the deliveries list endpoint is slow under load

Acceptance Criteria

  • Add $table->index(['webhook_id', 'resend_at'], 'webhook_deliveries_retry_index')
  • Add $table->index('status', 'webhook_deliveries_status_index')
  • Add to the existing 2026_01_29_000000_add_performance_indexes.php migration or create a new one

Discovered during automated scan (issue #3)

## Problem The `entitlement_webhook_deliveries` table (created in `Migrations/2026_01_26_140000_create_entitlement_webhooks_tables.php`) is missing indexes needed for common query patterns: 1. **`(webhook_id, resend_at)`** — used when querying deliveries due for retry 2. **`status`** — used when filtering deliveries by status (pending, failed, delivered) ## Impact - Retry queries scan the full deliveries table - Status-based filtering for the deliveries list endpoint is slow under load ## Acceptance Criteria - Add `$table->index(['webhook_id', 'resend_at'], 'webhook_deliveries_retry_index')` - Add `$table->index('status', 'webhook_deliveries_status_index')` - Add to the existing `2026_01_29_000000_add_performance_indexes.php` migration or create a new one _Discovered during automated scan (issue #3)_
Clotho added the
discovery
P3
labels 2026-02-20 16:44:02 +00:00
Clotho was assigned by Charon 2026-02-20 23:46:46 +00:00
Charon added the
agent-ready
label 2026-02-21 01:31:48 +00:00
Sign in to join this conversation.
No description provided.