CREATE INDEX CONCURRENTLY is not free, and half the time you do not need it
The standard advice is "always CREATE INDEX CONCURRENTLY in production". It is good advice and it is also a little lazy, because it skips over what the concurrent form costs and when you are paying that cost for nothing. So here are numbers. The setup Postgres 16, one table, twenty million rows, 1.6 GB on disk. While each index builds, a second session inserts one row every fifty milliseconds and…
We haven't written up this one. Dev.to has the full story — the link below goes straight to it.