Watch CREATE INDEX CONCURRENTLY progress
A CIC that reports 0 blocks done is usually not stuck, it is waiting. pg_stat_progress_create_index names the phase and hands you the PID it is waiting on, which is the difference between patience and a wrong cancel.
Problem
What you're actually looking at
The symptom as it shows up on a real server.
CREATE INDEX CONCURRENTLY spends its first phase doing no building at all. It waits for existing transactions to finish before it can trust the snapshot it will scan under. From outside the session it looks like nothing is happening, and the block counters genuinely are zero.
idx_routing_sort is being built on a 100,000-row depot_transfers without taking the table offline. Progress looks stuck at zero blocks until a writer commits, then the scan counters move.
Simple terms
CREATE INDEX CONCURRENTLY spends its whole first phase building nothing, it is waiting for older transactions to finish so it can trust the snapshot it will scan under. From the outside that looks exactly like a stuck job, and the block counter genuinely is zero. pg_stat_progress_create_index names the phase and even hands you the process ID it is waiting on, which is the difference between waiting patiently and cancelling something that was about to work.
Full runbook for this incident
- The full identify checklist, the exact signals that tell you it's this incident
- Every diagnostic query; lab output is attached only to the steps we actually captured
- The resolution path and the pitfalls that make it worse
- Mitigation steps to stop it recurring, plus a verify-you're-done query
Card required. Cancel before day 7 and you are not charged.
More in this category
Other Observability runbooks
Neighbouring incidents that share the same diagnostic surface.
Connected
How this connects to the rest of the library
A live view of this page's real cross-references, what explains it, what fixes it, what to tune, and where to go next. Every link is an authored relationship, not a guess.
Need the full procedure?
Pro runbooks finish the incident path
Free runbooks teach the shape. Pro opens the full step transcript, edge cases, and prevention depth.