4.14. Table Usage Metrics #
Metrics based on the pg_stat_all_tables, pg_statio_all_tables, and pg_tables views, collected by the following plugins:
the tables_size plugin:
postgresql.tables.size_bytes{database, schema, table}postgresql.tables.heap_size_bytes{database, schema, table}postgresql.tables.toast_size_bytes{database, schema, table}
the tables plugin:
postgresql.tables.seq_scan{database, schema, table}postgresql.tables.seq_tuples_fetch{database, schema, table}postgresql.tables.index_scan{database, schema, table}postgresql.tables.index_tuples_fetch{database, schema, table}postgresql.tables.tuples_dead{database, schema, table}postgresql.tables.tuples_deleted{database, schema, table}postgresql.tables.tuples_hot_updated{database, schema, table}postgresql.tables.tuples_inserted_since_vacuum{database, schema, table}postgresql.tables.tuples_inserted{database, schema, table}postgresql.tables.tuples_live{database, schema, table}postgresql.tables.tuples_modified_since_analyze{database, schema, table}postgresql.tables.tuples_updated{database, schema, table}
the tables_vacuum plugin:
postgresql.tables.vacuum_count{database, schema, table}postgresql.tables.last_vacuum_time_unixtime{database, schema, table}postgresql.tables.autovacuum_count{database, schema, table}postgresql.tables.last_autovacuum_time_unixtime{database, schema, table}postgresql.tables.analyze_count{database, schema, table}postgresql.tables.last_analyze_time_unixtime{database, schema, table}postgresql.tables.autoanalyze_count{database, schema, table}postgresql.tables.last_autoanalyze_time_unixtime{database, schema, table}available from Postgres Pro and PostgreSQL 18:
postgresql.tables.total_autoanalyze_time_milliseconds{database, schema, table}postgresql.tables.total_autovacuum_time_milliseconds{database, schema, table}postgresql.tables.total_analyze_time_milliseconds{database, schema, table}postgresql.tables.total_vacuum_time_milliseconds{database, schema, table}
the tables_io plugin:
postgresql.tables.heap_blocks_read{database, schema, table}postgresql.tables.heap_blocks_hit{database, schema, table}postgresql.tables.index_blocks_read{database, schema, table}postgresql.tables.index_blocks_hit{database, schema, table}postgresql.tables.toast_heap_blocks_read{database, schema, table}postgresql.tables.toast_heap_blocks_hit{database, schema, table}postgresql.tables.toast_index_blocks_hit{database, schema, table}postgresql.tables.toast_index_blocks_read{database, schema, table}