Reputation: 2265
I am just wondering what is the correct behaviour when creating concurrent indexes in Rails.
I am using this in my migration file:
disable_ddl_transaction!
def change
add_index :table_name, :field_name, algorithm: :concurrently
end
This should create a postgres concurrent index.
My question is: When running rake db:migrate
Is the correct behaviour to wait for the creation of the index? I mean, the migration will wait until the index is created? Or it should end and delegate postgres that responsibility?
P.S. It is a really big index.
Upvotes: 3
Views: 1854
Reputation: 2265
I found out it is the correct behavior. Regardless the migration is waiting, the index will be created concurrently as expected.
Writes and reads are allowed in creation time.
Upvotes: 4