Adding indexes to large PostgreSQL tables in production Rails apps can cause deployment failures due to lock timeouts. Standard index creation requires a SHARE lock that conflicts with write operations, and concurrent index creation can't run inside a transaction. The post presents a 'delayed migrations' pattern: a separate
Table of contents
Other issues caused by concurrent index creationDelayed migrations to the rescueFinal thoughtsSort: