Files
windmill/backend/migrations
Ruben Fiszel 65f0070fc0 fix: add partial index for fast failure filtering on runs page (#8150)
When failures are sparse (<1%), filtering by failure status on the runs
page required scanning millions of success rows. Add a partial index on
v2_job_completed (workspace_id, completed_at DESC) WHERE status IN
('failure', 'canceled') and switch ORDER BY to completed_at when
filtering failures, so Postgres walks the small partial index directly.

Benchmarked at 5.2M rows / 1% failure rate:
- LIMIT 30:   800ms -> 0.4ms (2000x faster)
- LIMIT 1000: 550ms -> 21ms  (26x faster)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:18:34 +00:00
..
2022-05-05 04:25:58 +02:00
2022-05-05 04:25:58 +02:00
2022-05-05 04:25:58 +02:00
2022-05-05 04:25:58 +02:00
2022-05-05 04:25:58 +02:00
2022-05-05 04:25:58 +02:00
2022-05-05 04:25:58 +02:00
2022-11-26 19:39:37 +01:00
v2
2023-11-22 18:29:51 +01:00
v2
2023-11-22 18:29:51 +01:00