How PostgreSQL Builds Indexes Without Blocking Writes
CREATE INDEX takes a SHARE lock on the table for the entire build. That blocks all writes, which could be minutes or hours of downtime for large tables. CREATE INDEX CONCURRENTLY avoids this by sp...