简体   繁体   English

如何检查postgres是否同时索引?

[英]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?如何检查新记录插入和更新操作的索引是否同时发生?

Any currently executed statements are visible in pg_stat_activity.query column.任何当前执行的语句都在pg_stat_activity.query列中可见。 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.这种类型的索引在元数据中可见,但在创建完成之前它会被标记为INVALID

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM