pg_stat_sys_indexes
pg_stat_sys_indexes
is a statistics view showing statistics about accesses to each system table index in the current database.
pg_stat_sys_indexes
was added in PostgreSQL 7.2.
Definition by PostgreSQL version
pg_stat_sys_indexes (PostgreSQL 16)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Collation | Nullable | Default ---------------+--------+-----------+----------+--------- relid | oid | | | indexrelid | oid | | | schemaname | name | | | relname | name | | | indexrelname | name | | | idx_scan | bigint | | | idx_tup_read | bigint | | | idx_tup_fetch | bigint | | |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 15)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Collation | Nullable | Default ---------------+--------+-----------+----------+--------- relid | oid | | | indexrelid | oid | | | schemaname | name | | | relname | name | | | indexrelname | name | | | idx_scan | bigint | | | idx_tup_read | bigint | | | idx_tup_fetch | bigint | | |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 14)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Collation | Nullable | Default ---------------+--------+-----------+----------+--------- relid | oid | | | indexrelid | oid | | | schemaname | name | | | relname | name | | | indexrelname | name | | | idx_scan | bigint | | | idx_tup_read | bigint | | | idx_tup_fetch | bigint | | |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 13)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Collation | Nullable | Default ---------------+--------+-----------+----------+--------- relid | oid | | | indexrelid | oid | | | schemaname | name | | | relname | name | | | indexrelname | name | | | idx_scan | bigint | | | idx_tup_read | bigint | | | idx_tup_fetch | bigint | | |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 12)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Collation | Nullable | Default ---------------+--------+-----------+----------+--------- relid | oid | | | indexrelid | oid | | | schemaname | name | | | relname | name | | | indexrelname | name | | | idx_scan | bigint | | | idx_tup_read | bigint | | | idx_tup_fetch | bigint | | |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 11)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Collation | Nullable | Default ---------------+--------+-----------+----------+--------- relid | oid | | | indexrelid | oid | | | schemaname | name | | | relname | name | | | indexrelname | name | | | idx_scan | bigint | | | idx_tup_read | bigint | | | idx_tup_fetch | bigint | | |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 10)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Collation | Nullable | Default ---------------+--------+-----------+----------+--------- relid | oid | | | indexrelid | oid | | | schemaname | name | | | relname | name | | | indexrelname | name | | | idx_scan | bigint | | | idx_tup_read | bigint | | | idx_tup_fetch | bigint | | |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 9.6)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Modifiers ---------------+--------+----------- relid | oid | indexrelid | oid | schemaname | name | relname | name | indexrelname | name | idx_scan | bigint | idx_tup_read | bigint | idx_tup_fetch | bigint |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 9.5)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Modifiers ---------------+--------+----------- relid | oid | indexrelid | oid | schemaname | name | relname | name | indexrelname | name | idx_scan | bigint | idx_tup_read | bigint | idx_tup_fetch | bigint |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 9.4)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Modifiers ---------------+--------+----------- relid | oid | indexrelid | oid | schemaname | name | relname | name | indexrelname | name | idx_scan | bigint | idx_tup_read | bigint | idx_tup_fetch | bigint |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 9.3)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Modifiers ---------------+--------+----------- relid | oid | indexrelid | oid | schemaname | name | relname | name | indexrelname | name | idx_scan | bigint | idx_tup_read | bigint | idx_tup_fetch | bigint |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 9.2)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Modifiers ---------------+--------+----------- relid | oid | indexrelid | oid | schemaname | name | relname | name | indexrelname | name | idx_scan | bigint | idx_tup_read | bigint | idx_tup_fetch | bigint |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 9.1)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Modifiers ---------------+--------+----------- relid | oid | indexrelid | oid | schemaname | name | relname | name | indexrelname | name | idx_scan | bigint | idx_tup_read | bigint | idx_tup_fetch | bigint |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 9.0)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Modifiers ---------------+--------+----------- relid | oid | indexrelid | oid | schemaname | name | relname | name | indexrelname | name | idx_scan | bigint | idx_tup_read | bigint | idx_tup_fetch | bigint |
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 8.4)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Modifiers ---------------+--------+----------- relid | oid | indexrelid | oid | schemaname | name | relname | name | indexrelname | name | idx_scan | bigint | idx_tup_read | bigint | idx_tup_fetch | bigint | 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 = ANY (ARRAY['pg_catalog'::name, 'information_schema'::name])) OR pg_stat_all_indexes.schemaname ~ '^pg_toast'::text;
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 8.3)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Modifiers ---------------+--------+----------- relid | oid | indexrelid | oid | schemaname | name | relname | name | indexrelname | name | idx_scan | bigint | idx_tup_read | bigint | idx_tup_fetch | bigint | 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 = ANY (ARRAY['pg_catalog'::name, 'information_schema'::name])) OR pg_stat_all_indexes.schemaname ~ '^pg_toast'::text;
Documentation: pg_stat_sys_indexes
pg_stat_sys_indexes (PostgreSQL 8.2)
View "pg_catalog.pg_stat_sys_indexes" Column | Type | Modifiers ---------------+--------+----------- relid | oid | indexrelid | oid | schemaname | name | relname | name | indexrelname | name | idx_scan | bigint | idx_tup_read | bigint | idx_tup_fetch | bigint | 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 = ANY (ARRAY['pg_catalog'::name, 'pg_toast'::name, 'information_schema'::name]);
Documentation: pg_stat_sys_indexes
Change history
- PostgreSQL 7.2
- added (commit 8d80b0d9)
Examples
Sample contents of pg_stat_sys_indexes
on a PostgreSQL 13 installation:
postgres=# SELECT * FROM pg_stat_sys_indexes ORDER BY relid LIMIT 10; relid | indexrelid | schemaname | relname | indexrelname | idx_scan | idx_tup_read | idx_tup_fetch -------+------------+------------+----------------+-----------------------------------+----------+--------------+--------------- 826 | 828 | pg_catalog | pg_default_acl | pg_default_acl_oid_index | 0 | 0 | 0 826 | 827 | pg_catalog | pg_default_acl | pg_default_acl_role_nsp_obj_index | 2 | 0 | 0 1213 | 2698 | pg_catalog | pg_tablespace | pg_tablespace_spcname_index | 0 | 0 | 0 1213 | 2697 | pg_catalog | pg_tablespace | pg_tablespace_oid_index | 7 | 7 | 7 1214 | 1232 | pg_catalog | pg_shdepend | pg_shdepend_depender_index | 1 | 0 | 0 1214 | 1233 | pg_catalog | pg_shdepend | pg_shdepend_reference_index | 29 | 28 | 28 1247 | 2704 | pg_catalog | pg_type | pg_type_typname_nsp_index | 13 | 8 | 8 1247 | 2703 | pg_catalog | pg_type | pg_type_oid_index | 66 | 64 | 64 1249 | 2658 | pg_catalog | pg_attribute | pg_attribute_relid_attnam_index | 0 | 0 | 0 1249 | 2659 | pg_catalog | pg_attribute | pg_attribute_relid_attnum_index | 521 | 1023 | 1023 (10 rows)
References
- PostgreSQL documentation: pg_stat_sys_indexes