Migration summary from priya-n
The dispatch planner reads shipments whose status changed in the last fifteen minutes. It scans 41.2 million rows to find about nine hundred, and the p95 on that query has been over four seconds since the July backfill.
This replaces the unused index on status with a partial index on status_changed_at covering the three statuses the planner asks for. The index build is concurrent, so writes keep flowing while it runs.
#476 finished populating the column in July, so the NOT NULL in the same file is now safe to set.