CREATE INDEX on a live Postgres table locks writes. CONCURRENTLY fixes that, if you keep it out of a transaction
DEV Community
CREATE INDEX on a live Postgres table locks writes. CONCURRENTLY fixes that, if you keep it out of a transaction
Plain CREATE INDEX takes a SHARE lock and blocks INSERT/UPDATE/DELETE until the build finishes. CREATE INDEX CONCURRENTLY avoids that, but Postgres refuses it inside a transaction block, and most migration tools wrap every migration in one.
0 comments
No comments yet.