pg_statio_user_indexes

显示每个用户索引的 IO 统计信息的统计视图

pg_statio_user_indexes 是一个 统计视图,显示当前数据库中每个用户索引的 IO 统计信息。

pg_statio_user_indexesPostgreSQL 7.2 中添加。

按 PostgreSQL 版本定义

pg_statio_user_indexes (PostgreSQL 17)

        View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Collation | Nullable | Default 
---------------+--------+-----------+----------+---------
 relid         | oid    |           |          | 
 indexrelid    | oid    |           |          | 
 schemaname    | name   |           |          | 
 relname       | name   |           |          | 
 indexrelname  | name   |           |          | 
 idx_blks_read | bigint |           |          | 
 idx_blks_hit  | bigint |           |          |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 16)

        View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Collation | Nullable | Default 
---------------+--------+-----------+----------+---------
 relid         | oid    |           |          | 
 indexrelid    | oid    |           |          | 
 schemaname    | name   |           |          | 
 relname       | name   |           |          | 
 indexrelname  | name   |           |          | 
 idx_blks_read | bigint |           |          | 
 idx_blks_hit  | bigint |           |          |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 15)

        View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Collation | Nullable | Default 
---------------+--------+-----------+----------+---------
 relid         | oid    |           |          | 
 indexrelid    | oid    |           |          | 
 schemaname    | name   |           |          | 
 relname       | name   |           |          | 
 indexrelname  | name   |           |          | 
 idx_blks_read | bigint |           |          | 
 idx_blks_hit  | bigint |           |          |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 14)

        View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Collation | Nullable | Default 
---------------+--------+-----------+----------+---------
 relid         | oid    |           |          | 
 indexrelid    | oid    |           |          | 
 schemaname    | name   |           |          | 
 relname       | name   |           |          | 
 indexrelname  | name   |           |          | 
 idx_blks_read | bigint |           |          | 
 idx_blks_hit  | bigint |           |          |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 13)

        View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Collation | Nullable | Default 
---------------+--------+-----------+----------+---------
 relid         | oid    |           |          | 
 indexrelid    | oid    |           |          | 
 schemaname    | name   |           |          | 
 relname       | name   |           |          | 
 indexrelname  | name   |           |          | 
 idx_blks_read | bigint |           |          | 
 idx_blks_hit  | bigint |           |          |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 12)

        View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Collation | Nullable | Default 
---------------+--------+-----------+----------+---------
 relid         | oid    |           |          | 
 indexrelid    | oid    |           |          | 
 schemaname    | name   |           |          | 
 relname       | name   |           |          | 
 indexrelname  | name   |           |          | 
 idx_blks_read | bigint |           |          | 
 idx_blks_hit  | bigint |           |          |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 11)

        View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Collation | Nullable | Default 
---------------+--------+-----------+----------+---------
 relid         | oid    |           |          | 
 indexrelid    | oid    |           |          | 
 schemaname    | name   |           |          | 
 relname       | name   |           |          | 
 indexrelname  | name   |           |          | 
 idx_blks_read | bigint |           |          | 
 idx_blks_hit  | bigint |           |          |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 10)

        View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Collation | Nullable | Default 
---------------+--------+-----------+----------+---------
 relid         | oid    |           |          | 
 indexrelid    | oid    |           |          | 
 schemaname    | name   |           |          | 
 relname       | name   |           |          | 
 indexrelname  | name   |           |          | 
 idx_blks_read | bigint |           |          | 
 idx_blks_hit  | bigint |           |          |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 9.6)

View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Modifiers 
---------------+--------+-----------
 relid         | oid    | 
 indexrelid    | oid    | 
 schemaname    | name   | 
 relname       | name   | 
 indexrelname  | name   | 
 idx_blks_read | bigint | 
 idx_blks_hit  | bigint |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 9.5)

View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Modifiers 
---------------+--------+-----------
 relid         | oid    | 
 indexrelid    | oid    | 
 schemaname    | name   | 
 relname       | name   | 
 indexrelname  | name   | 
 idx_blks_read | bigint | 
 idx_blks_hit  | bigint |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 9.4)

View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Modifiers 
---------------+--------+-----------
 relid         | oid    | 
 indexrelid    | oid    | 
 schemaname    | name   | 
 relname       | name   | 
 indexrelname  | name   | 
 idx_blks_read | bigint | 
 idx_blks_hit  | bigint |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 9.3)

View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Modifiers 
---------------+--------+-----------
 relid         | oid    | 
 indexrelid    | oid    | 
 schemaname    | name   | 
 relname       | name   | 
 indexrelname  | name   | 
 idx_blks_read | bigint | 
 idx_blks_hit  | bigint |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 9.2)

View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Modifiers 
---------------+--------+-----------
 relid         | oid    | 
 indexrelid    | oid    | 
 schemaname    | name   | 
 relname       | name   | 
 indexrelname  | name   | 
 idx_blks_read | bigint | 
 idx_blks_hit  | bigint |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 9.1)

View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Modifiers 
---------------+--------+-----------
 relid         | oid    | 
 indexrelid    | oid    | 
 schemaname    | name   | 
 relname       | name   | 
 indexrelname  | name   | 
 idx_blks_read | bigint | 
 idx_blks_hit  | bigint |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 9.0)

View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Modifiers 
---------------+--------+-----------
 relid         | oid    | 
 indexrelid    | oid    | 
 schemaname    | name   | 
 relname       | name   | 
 indexrelname  | name   | 
 idx_blks_read | bigint | 
 idx_blks_hit  | bigint |
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 8.4)

View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Modifiers 
---------------+--------+-----------
 relid         | oid    | 
 indexrelid    | oid    | 
 schemaname    | name   | 
 relname       | name   | 
 indexrelname  | name   | 
 idx_blks_read | bigint | 
 idx_blks_hit  | bigint | 
View definition:
 SELECT pg_statio_all_indexes.relid, pg_statio_all_indexes.indexrelid, pg_statio_all_indexes.schemaname, pg_statio_all_indexes.relname, pg_statio_all_indexes.indexrelname, pg_statio_all_indexes.idx_blks_read, pg_statio_all_indexes.idx_blks_hit
   FROM pg_statio_all_indexes
  WHERE (pg_statio_all_indexes.schemaname <> ALL (ARRAY['pg_catalog'::name, 'information_schema'::name])) AND pg_statio_all_indexes.schemaname !~ '^pg_toast'::text;
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 8.3)

View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Modifiers 
---------------+--------+-----------
 relid         | oid    | 
 indexrelid    | oid    | 
 schemaname    | name   | 
 relname       | name   | 
 indexrelname  | name   | 
 idx_blks_read | bigint | 
 idx_blks_hit  | bigint | 
View definition:
 SELECT pg_statio_all_indexes.relid, pg_statio_all_indexes.indexrelid, pg_statio_all_indexes.schemaname, pg_statio_all_indexes.relname, pg_statio_all_indexes.indexrelname, pg_statio_all_indexes.idx_blks_read, pg_statio_all_indexes.idx_blks_hit
   FROM pg_statio_all_indexes
  WHERE (pg_statio_all_indexes.schemaname <> ALL (ARRAY['pg_catalog'::name, 'information_schema'::name])) AND pg_statio_all_indexes.schemaname !~ '^pg_toast'::text;
    

文档: pg_statio_user_indexes

pg_statio_user_indexes (PostgreSQL 8.2)

View "pg_catalog.pg_statio_user_indexes"
    Column     |  Type  | Modifiers 
---------------+--------+-----------
 relid         | oid    | 
 indexrelid    | oid    | 
 schemaname    | name   | 
 relname       | name   | 
 indexrelname  | name   | 
 idx_blks_read | bigint | 
 idx_blks_hit  | bigint | 
View definition:
 SELECT pg_statio_all_indexes.relid, pg_statio_all_indexes.indexrelid, pg_statio_all_indexes.schemaname, pg_statio_all_indexes.relname, pg_statio_all_indexes.indexrelname, pg_statio_all_indexes.idx_blks_read, pg_statio_all_indexes.idx_blks_hit
   FROM pg_statio_all_indexes
  WHERE pg_statio_all_indexes.schemaname <> ALL (ARRAY['pg_catalog'::name, 'pg_toast'::name, 'information_schema'::name]);
    

文档: pg_statio_user_indexes

更改历史记录

示例

pg_statio_user_indexes 记录的示例内容

app=> SELECT * FROM pg_statio_user_indexes LIMIT 1\gx
-[ RECORD 1 ]-+---------------------------------
relid         | 16791
indexrelid    | 17306
schemaname    | app
relname       | category_language
indexrelname  | category_language_cat_id_lang_id
idx_blks_read | 16
idx_blks_hit  | 2341576

分类

统计/监控视图

另请参阅

pg_stat_all_indexespg_stat_sys_indexespg_stat_user_indexespg_statio_all_indexespg_statio_sys_indexes

反馈

提交任何关于 "pg_statio_user_indexes" 的评论、建议或更正 此处