문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top