Ajay Anarse
Ajay Anarse

Reputation: 56

How to check if postgres is indexing concurrently?

I have a written this migration to index concurrently:

add_index :table_name, %i[field1 field2], algorithm: :concurrently

How do I check if indexing is happening concurrently for new records insertion and update operation?

Upvotes: 0

Views: 489

Answers (1)

Pavel Stehule
Pavel Stehule

Reputation: 45770

Any currently executed statements are visible in pg_stat_activity.query column. So you can verify it there. More. This type of index is visible in metadata, but it is flagged as INVALID until the creating is done.

Upvotes: 1

Related Questions