pg_statio_sys_tables

显示每个系统表IO统计信息的统计视图

pg_statio_sys_tables 是一个统计视图,显示当前数据库中每个系统表的IO统计信息。

pg_statio_sys_tablesPostgreSQL 7.2中添加。

按PostgreSQL版本定义

pg_statio_sys_tables (PostgreSQL 17)

          View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Collation | Nullable | Default 
-----------------+--------+-----------+----------+---------
 relid           | oid    |           |          | 
 schemaname      | name   |           |          | 
 relname         | name   |           |          | 
 heap_blks_read  | bigint |           |          | 
 heap_blks_hit   | bigint |           |          | 
 idx_blks_read   | bigint |           |          | 
 idx_blks_hit    | bigint |           |          | 
 toast_blks_read | bigint |           |          | 
 toast_blks_hit  | bigint |           |          | 
 tidx_blks_read  | bigint |           |          | 
 tidx_blks_hit   | bigint |           |          |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 16)

          View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Collation | Nullable | Default 
-----------------+--------+-----------+----------+---------
 relid           | oid    |           |          | 
 schemaname      | name   |           |          | 
 relname         | name   |           |          | 
 heap_blks_read  | bigint |           |          | 
 heap_blks_hit   | bigint |           |          | 
 idx_blks_read   | bigint |           |          | 
 idx_blks_hit    | bigint |           |          | 
 toast_blks_read | bigint |           |          | 
 toast_blks_hit  | bigint |           |          | 
 tidx_blks_read  | bigint |           |          | 
 tidx_blks_hit   | bigint |           |          |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 15)

          View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Collation | Nullable | Default 
-----------------+--------+-----------+----------+---------
 relid           | oid    |           |          | 
 schemaname      | name   |           |          | 
 relname         | name   |           |          | 
 heap_blks_read  | bigint |           |          | 
 heap_blks_hit   | bigint |           |          | 
 idx_blks_read   | bigint |           |          | 
 idx_blks_hit    | bigint |           |          | 
 toast_blks_read | bigint |           |          | 
 toast_blks_hit  | bigint |           |          | 
 tidx_blks_read  | bigint |           |          | 
 tidx_blks_hit   | bigint |           |          |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 14)

          View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Collation | Nullable | Default 
-----------------+--------+-----------+----------+---------
 relid           | oid    |           |          | 
 schemaname      | name   |           |          | 
 relname         | name   |           |          | 
 heap_blks_read  | bigint |           |          | 
 heap_blks_hit   | bigint |           |          | 
 idx_blks_read   | bigint |           |          | 
 idx_blks_hit    | bigint |           |          | 
 toast_blks_read | bigint |           |          | 
 toast_blks_hit  | bigint |           |          | 
 tidx_blks_read  | bigint |           |          | 
 tidx_blks_hit   | bigint |           |          |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 13)

          View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Collation | Nullable | Default 
-----------------+--------+-----------+----------+---------
 relid           | oid    |           |          | 
 schemaname      | name   |           |          | 
 relname         | name   |           |          | 
 heap_blks_read  | bigint |           |          | 
 heap_blks_hit   | bigint |           |          | 
 idx_blks_read   | bigint |           |          | 
 idx_blks_hit    | bigint |           |          | 
 toast_blks_read | bigint |           |          | 
 toast_blks_hit  | bigint |           |          | 
 tidx_blks_read  | bigint |           |          | 
 tidx_blks_hit   | bigint |           |          |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 12)

          View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Collation | Nullable | Default 
-----------------+--------+-----------+----------+---------
 relid           | oid    |           |          | 
 schemaname      | name   |           |          | 
 relname         | name   |           |          | 
 heap_blks_read  | bigint |           |          | 
 heap_blks_hit   | bigint |           |          | 
 idx_blks_read   | bigint |           |          | 
 idx_blks_hit    | bigint |           |          | 
 toast_blks_read | bigint |           |          | 
 toast_blks_hit  | bigint |           |          | 
 tidx_blks_read  | bigint |           |          | 
 tidx_blks_hit   | bigint |           |          |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 11)

          View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Collation | Nullable | Default 
-----------------+--------+-----------+----------+---------
 relid           | oid    |           |          | 
 schemaname      | name   |           |          | 
 relname         | name   |           |          | 
 heap_blks_read  | bigint |           |          | 
 heap_blks_hit   | bigint |           |          | 
 idx_blks_read   | bigint |           |          | 
 idx_blks_hit    | bigint |           |          | 
 toast_blks_read | bigint |           |          | 
 toast_blks_hit  | bigint |           |          | 
 tidx_blks_read  | bigint |           |          | 
 tidx_blks_hit   | bigint |           |          |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 10)

          View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Collation | Nullable | Default 
-----------------+--------+-----------+----------+---------
 relid           | oid    |           |          | 
 schemaname      | name   |           |          | 
 relname         | name   |           |          | 
 heap_blks_read  | bigint |           |          | 
 heap_blks_hit   | bigint |           |          | 
 idx_blks_read   | bigint |           |          | 
 idx_blks_hit    | bigint |           |          | 
 toast_blks_read | bigint |           |          | 
 toast_blks_hit  | bigint |           |          | 
 tidx_blks_read  | bigint |           |          | 
 tidx_blks_hit   | bigint |           |          |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 9.6)

View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Modifiers 
-----------------+--------+-----------
 relid           | oid    | 
 schemaname      | name   | 
 relname         | name   | 
 heap_blks_read  | bigint | 
 heap_blks_hit   | bigint | 
 idx_blks_read   | bigint | 
 idx_blks_hit    | bigint | 
 toast_blks_read | bigint | 
 toast_blks_hit  | bigint | 
 tidx_blks_read  | bigint | 
 tidx_blks_hit   | bigint |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 9.5)

View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Modifiers 
-----------------+--------+-----------
 relid           | oid    | 
 schemaname      | name   | 
 relname         | name   | 
 heap_blks_read  | bigint | 
 heap_blks_hit   | bigint | 
 idx_blks_read   | bigint | 
 idx_blks_hit    | bigint | 
 toast_blks_read | bigint | 
 toast_blks_hit  | bigint | 
 tidx_blks_read  | bigint | 
 tidx_blks_hit   | bigint |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 9.4)

View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Modifiers 
-----------------+--------+-----------
 relid           | oid    | 
 schemaname      | name   | 
 relname         | name   | 
 heap_blks_read  | bigint | 
 heap_blks_hit   | bigint | 
 idx_blks_read   | bigint | 
 idx_blks_hit    | bigint | 
 toast_blks_read | bigint | 
 toast_blks_hit  | bigint | 
 tidx_blks_read  | bigint | 
 tidx_blks_hit   | bigint |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 9.3)

View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Modifiers 
-----------------+--------+-----------
 relid           | oid    | 
 schemaname      | name   | 
 relname         | name   | 
 heap_blks_read  | bigint | 
 heap_blks_hit   | bigint | 
 idx_blks_read   | bigint | 
 idx_blks_hit    | bigint | 
 toast_blks_read | bigint | 
 toast_blks_hit  | bigint | 
 tidx_blks_read  | bigint | 
 tidx_blks_hit   | bigint |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 9.2)

View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Modifiers 
-----------------+--------+-----------
 relid           | oid    | 
 schemaname      | name   | 
 relname         | name   | 
 heap_blks_read  | bigint | 
 heap_blks_hit   | bigint | 
 idx_blks_read   | bigint | 
 idx_blks_hit    | bigint | 
 toast_blks_read | bigint | 
 toast_blks_hit  | bigint | 
 tidx_blks_read  | bigint | 
 tidx_blks_hit   | bigint |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 9.1)

View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Modifiers 
-----------------+--------+-----------
 relid           | oid    | 
 schemaname      | name   | 
 relname         | name   | 
 heap_blks_read  | bigint | 
 heap_blks_hit   | bigint | 
 idx_blks_read   | bigint | 
 idx_blks_hit    | bigint | 
 toast_blks_read | bigint | 
 toast_blks_hit  | bigint | 
 tidx_blks_read  | bigint | 
 tidx_blks_hit   | bigint |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 9.0)

View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Modifiers 
-----------------+--------+-----------
 relid           | oid    | 
 schemaname      | name   | 
 relname         | name   | 
 heap_blks_read  | bigint | 
 heap_blks_hit   | bigint | 
 idx_blks_read   | bigint | 
 idx_blks_hit    | bigint | 
 toast_blks_read | bigint | 
 toast_blks_hit  | bigint | 
 tidx_blks_read  | bigint | 
 tidx_blks_hit   | bigint |
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 8.4)

View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Modifiers 
-----------------+--------+-----------
 relid           | oid    | 
 schemaname      | name   | 
 relname         | name   | 
 heap_blks_read  | bigint | 
 heap_blks_hit   | bigint | 
 idx_blks_read   | bigint | 
 idx_blks_hit    | bigint | 
 toast_blks_read | bigint | 
 toast_blks_hit  | bigint | 
 tidx_blks_read  | bigint | 
 tidx_blks_hit   | bigint | 
View definition:
 SELECT pg_statio_all_tables.relid, pg_statio_all_tables.schemaname, pg_statio_all_tables.relname, pg_statio_all_tables.heap_blks_read, pg_statio_all_tables.heap_blks_hit, pg_statio_all_tables.idx_blks_read, pg_statio_all_tables.idx_blks_hit, pg_statio_all_tables.toast_blks_read, pg_statio_all_tables.toast_blks_hit, pg_statio_all_tables.tidx_blks_read, pg_statio_all_tables.tidx_blks_hit
   FROM pg_statio_all_tables
  WHERE (pg_statio_all_tables.schemaname = ANY (ARRAY['pg_catalog'::name, 'information_schema'::name])) OR pg_statio_all_tables.schemaname ~ '^pg_toast'::text;
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 8.3)

View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Modifiers 
-----------------+--------+-----------
 relid           | oid    | 
 schemaname      | name   | 
 relname         | name   | 
 heap_blks_read  | bigint | 
 heap_blks_hit   | bigint | 
 idx_blks_read   | bigint | 
 idx_blks_hit    | bigint | 
 toast_blks_read | bigint | 
 toast_blks_hit  | bigint | 
 tidx_blks_read  | bigint | 
 tidx_blks_hit   | bigint | 
View definition:
 SELECT pg_statio_all_tables.relid, pg_statio_all_tables.schemaname, pg_statio_all_tables.relname, pg_statio_all_tables.heap_blks_read, pg_statio_all_tables.heap_blks_hit, pg_statio_all_tables.idx_blks_read, pg_statio_all_tables.idx_blks_hit, pg_statio_all_tables.toast_blks_read, pg_statio_all_tables.toast_blks_hit, pg_statio_all_tables.tidx_blks_read, pg_statio_all_tables.tidx_blks_hit
   FROM pg_statio_all_tables
  WHERE (pg_statio_all_tables.schemaname = ANY (ARRAY['pg_catalog'::name, 'information_schema'::name])) OR pg_statio_all_tables.schemaname ~ '^pg_toast'::text;
    

文档: pg_statio_sys_tables

pg_statio_sys_tables (PostgreSQL 8.2)

View "pg_catalog.pg_statio_sys_tables"
     Column      |  Type  | Modifiers 
-----------------+--------+-----------
 relid           | oid    | 
 schemaname      | name   | 
 relname         | name   | 
 heap_blks_read  | bigint | 
 heap_blks_hit   | bigint | 
 idx_blks_read   | bigint | 
 idx_blks_hit    | bigint | 
 toast_blks_read | bigint | 
 toast_blks_hit  | bigint | 
 tidx_blks_read  | bigint | 
 tidx_blks_hit   | bigint | 
View definition:
 SELECT pg_statio_all_tables.relid, pg_statio_all_tables.schemaname, pg_statio_all_tables.relname, pg_statio_all_tables.heap_blks_read, pg_statio_all_tables.heap_blks_hit, pg_statio_all_tables.idx_blks_read, pg_statio_all_tables.idx_blks_hit, pg_statio_all_tables.toast_blks_read, pg_statio_all_tables.toast_blks_hit, pg_statio_all_tables.tidx_blks_read, pg_statio_all_tables.tidx_blks_hit
   FROM pg_statio_all_tables
  WHERE pg_statio_all_tables.schemaname = ANY (ARRAY['pg_catalog'::name, 'pg_toast'::name, 'information_schema'::name]);
    

文档: pg_statio_sys_tables

更改历史记录

示例

来自pg_statio_sys_tables的示例行

epp=# SELECT * FROM pg_statio_sys_tables WHERE relname = 'pg_statistic';
-[ RECORD 1 ]---+-------------
relid           | 2619
schemaname      | pg_catalog
relname         | pg_statistic
heap_blks_read  | 59233
heap_blks_hit   | 1688433915
idx_blks_read   | 1190
idx_blks_hit    | 244320971
toast_blks_read | 277866
toast_blks_hit  | 1495510954
tidx_blks_read  | 496
tidx_blks_hit   | 32927675

分类

统计/监控视图

另请参见

pg_stat_all_tablespg_stat_sys_tablespg_stat_user_tablespg_stat_xact_all_tablespg_stat_xact_user_tablespg_stat_xact_sys_tablespg_statio_all_tablespg_statio_sys_tablespg_statio_user_tables

反馈

提交您对“pg_statio_sys_tables”的任何评论、建议或更正 此处