index-concurrently
CREATE INDEX without CONCURRENTLY — locks the table against writes.
Why
Building an index normally blocks writes to an existing PostgreSQL table for the duration of the build.
Fix
Use CREATE INDEX CONCURRENTLY in a nontransactional migration.
Examples
CREATE INDEX users_email_idx ON users (email);CREATE INDEX CONCURRENTLY users_email_idx ON users (email);