RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  

How to Create Postgres Indexes Concurrently in ActiveRecord Migrations

By default, Postgres locks writes (but not reads) to a table while creating an index on it. That can result in unacceptable downtime during a production deploy. On a large table, indexing can take hours.

However, ActiveRecord 4 makes it easy to create Postgres indexes concurrently and avoid accidental downtime caused by long, write-blocking database indexing.


Post a Comment

Comment abilities for non registered users are currently deactivated, pending time to add a proper CAPTCHA to solve the escalating spam problem. Sorry!