A normal CREATE INDEX lets other sessions read the table, but every insert, update and delete waits until the index is built. On a big table that can be minutes of a frozen app.
CREATE INDEX CONCURRENTLY orders_customer_idx ON orders (customer_id);
With CONCURRENTLY, PostgreSQL builds the index while writes continue. It scans the table twice and waits for running transactions that could touch the table, so it takes longer and uses more I/O in total. For a production table that’s a trade I’d take every time.
There are rules. It cannot run inside a transaction block, so not between BEGIN and COMMIT, and many migration tools wrap each step in one by default. Check how yours lets you turn that off for one step.
The real trap is a failed build. If it stops halfway, for example on a deadlock or a duplicate in a unique index, it leaves an index behind that is marked invalid. That index is not used for queries but still slows down every write. \d orders shows it with INVALID after its name. The docs recommend dropping it and running the create again, or rebuilding it with REINDEX INDEX CONCURRENTLY. So after a concurrent build, I’d look at \d before I call it done. A long-running transaction elsewhere also makes the build wait, sometimes for a very long time.
Further reading: CREATE INDEX (building indexes concurrently)