| Tip 2 |
(tenant_id) |
Basic tenant lookup |
Still scanned ~59,689 rows |
| Tip 3 |
(tenant_id, status, category) |
Moves filtering into index scan |
Removed filter waste, but still sorted |
| Tip 5 attempt |
(tenant_id, status, category, created_at) |
Looks like it should help ORDER BY |
Did not eliminate the sort |
| Tip 5 winner |
(tenant_id, created_at) INCLUDE (status, category) |
Preserves order and stops early |
Dropped runtime to ~3.2 ms |
| Tip 6 final |
(tenant_id, created_at) INCLUDE (status, category, id, updated_at, user_id, source_id) |
Index Only Scan, no table reads |
Dropped runtime to ~1.4 ms |