时间:2021-07-01 10:21:17 帮助过:12人阅读
select relname, indexrelname, idx_scan, idx_tup_read, idx_tup_fetch from pg_stat_user_indexes order by idx_scan asc, idx_tup_read asc, idx_tup_fetch asc;
data_name=# \d+ pg_stat_user_indexes; View "pg_catalog.pg_stat_user_indexes" Column | Type | Modifiers | Storage | Description ---------------+--------+-----------+---------+------------- relid | oid | | plain | indexrelid | oid | | plain | schemaname | name | | plain | relname | name | | plain | indexrelname | name | | plain | idx_scan | bigint | | plain | idx_tup_read | bigint | | plain | idx_tup_fetch | bigint | | plain | View definition: SELECT pg_stat_all_indexes.relid, pg_stat_all_indexes.indexrelid, pg_stat_all_indexes.schemaname, pg_stat_all_indexes.relname, pg_stat_all_indexes.indexrelname, pg_stat_all_indexes.idx_scan, pg_stat_all_indexes.idx_tup_read, pg_stat_all_indexes.idx_tup_fetch FROM pg_stat_all_indexes WHERE (pg_stat_all_indexes.schemaname <> ALL (ARRAY[‘pg_catalog‘::name, ‘information_schema‘::name])) AND pg_stat_all_indexes.schemaname !~ ‘^pg_toast‘::text;
PostgreSQL查看索引的使用情况
标签:exe 使用情况 toast mat bsp style column odi catalog