Postgres index usage
От | Dirschel, Steve |
---|---|
Тема | Postgres index usage |
Дата | |
Msg-id | BL0PR03MB4001C72C153C481533CBFCDAFAB82@BL0PR03MB4001.namprd03.prod.outlook.com обсуждение исходный текст |
Ответ на | Re: "not related" code blocks for removal of dead rows when using vacuum and this kills the performance (Lars Aksel Opsahl <Lars.Opsahl@nibio.no>) |
Ответы |
RE: Postgres index usage
Re: Postgres index usage Re: Postgres index usage |
Список | pgsql-performance |
I’ve found multiple postings out there saying you can query pg_stat_all_indexes and look at idx_scan to know if an index has been used by queries. I want to be 100% sure I can rely on that table/column to know if an index has never been used.
I queried that table for a specific index and idx_scan is 0. I queried pg_statio_all_indexes and can see idx_blks_read and idx_blks_hit have numbers in there. If the index is not being used then what it causing idx_blks_read and idx_blks_hit to increase over time? I’m wondering if those increase due to DML on the table. Could anyone please confirm I can rely on pg_stat_all_index.idx_scan to know if queries are using an index and the increases over time in idx_blks_read and idx_blks_hit in pg_statio_all_indexes would be from DML (or possibly vacuum or other things)?
Thanks in advance.
В списке pgsql-performance по дате отправления: