Skip to content

.tips

238 small things, one a day. short enough to read between two other things, with a feed if you want them delivered.

.today

one small thing a day.

Never build an index on a live table without CONCURRENTLY

A plain CREATE INDEX takes a lock that blocks every write to the table for the whole build. On a big table that means minutes of outage that look like a hung app.

CREATE INDEX CONCURRENTLY orders_customer_idx ON orders (customer_id);

It's slower and can't run inside a transaction, so you'll have to tell your migration tool. If it fails halfway, it leaves an invalid index behind, so check pg_index.indisvalid and drop it before you retry.

postgresqlmigrations

.october

2026, 6 tips.

.september

2026, 19 tips.