Updated on 2024-09-02 GMT+08:00

PG_STAT_OBJECT

Records table statistics and autovacuum efficiency information of the current DB instance, and creates indexes for the databaseid, relid, and partid columns. Update of this system catalog is controlled by the enable_pg_stat_object parameter. This system catalog is supported only by clusters of version 8.2.1 or later.

Table 1 PG_STAT_OBJECT columns

Column

Type

Reference

Description

databaseid

oid

PG_DATABASE.oid

Database OID.

relid

oid

PG_CLASS.oid

Table OID. It is the OID of the primary table for a partitioned table.

partid

oid

PG_PARTITION

.oid

Partition OID. If the table is not partitioned, the value is 0.

numscans

bigint

N/A

Number of times that sequential scans are started.

tuples_returned

bigint

N/A

Number of visible tuples fetched by sequential scans.

tuples_fetched

bigint

N/A

Number of visible tuples fetched.

tuples_inserted

bigint

N/A

Number of inserted records.

tuples_updated

bigint

N/A

Number of updated records.

tuples_deleted

bigint

N/A

Number of deleted records.

tuples_hot_updated

bigint

N/A

Number of HOT updates.

n_live_tuples

bigint

N/A

Number of visible tuples.

last_autovacuum_begin_n_dead_tuple

bigint

N/A

Number of tuples deleted before Autovacuum is executed.

n_dead_tuples

bigint

N/A

Number of tuples deleted after Autovacuum is successful.

changes_since_analyze

bigint

N/A

Last data modification time after Analyze.

blocks_fetched

bigint

N/A

Number of selected pages.

blocks_hit

bigint

N/A

Number of scanned pages.

cu_mem_hit

bigint

N/A

Number of CU memory hits.

cu_hdd_sync

bigint

N/A

Times that CUs are synchronously read from disks.

cu_hdd_asyn

bigint

N/A

Times that CUs are asynchronously read from disks.

data_changed_timestamp

timestamp with time zone

N/A

Last data modification time.

data_access_timestamp

timestamp with time zone

N/A

Last access time of a table.

analyze_timestamp

timestamp with time zone

N/A

Last Analyze time.

analyze_count

bigint

N/A

Total number of Analyze times.

autovac_analyze_timestamp

timestamp with time zone

N/A

Last Autoanalyze time.

autovac_analyze_count

bigint

N/A

Total number of Autoanalyze times.

vacuum_timestamp

timestamp with time zone

N/A

Time of the latest Vacuum.

vacuum_count

bigint

N/A

Total number of Vacuum times.

autovac_vacuum_timestamp

timestamp with time zone

N/A

Last Autovacuum time.

autovac_vacuum_count

bigint

N/A

Total number of Autovacuum times.

autovacuum_success_count

bigint

N/A

Total number of successful Autovacuum operations.

last_autovacuum_time_cost

bigint

N/A

Time spent on the latest successful Autovacuum, in microseconds.

avg_autovacuum_time_cost

bigint

N/A

Average execution time of successful Autovacuum operations. Unit: μs.

last_autovacuum_failed_count

bigint

N/A

Total number of autovacuum failures since the last successful Autovacuum.

last_autovacuum_trigger

smallint

N/A

Triggering mode of the latest autovacuum, which helps maintenance personnel determine the Vacuum status.

last_autovacuum_oldestxmin

bigint

N/A

oldestxmin after the latest successful Autovacuum execution. If the table-level oldestxmin feature is enabled, this field records the value of oldestxmin used by the latest (AUTO)VACUUM of the table.

last_autovacuum_scan_pages

bigint

N/A

Number of pages last scanned by autovacuum (only for row-store tables).

last_autovacuum_dirty_pages

bigint

N/A

Number of pages last modified by Autovacuum (only for row-store tables).

last_autovacuum_clear_deadtuples

bigint

N/A

Number of dead tuples last cleared by Autovacuum (only for row-store tables)

sum_autovacuum_scan_pages

bigint

N/A

Total number of pages scanned by Autovacuum since database initialization (only for row-store tables).

sum_autovacuum_dirty_pages

bigint

N/A

Number of pages modified by Autovacuum since database initialization (only for row-store tables).

sum_autovacuum_clear_deadtuples

bigint

N/A

Total number of dead tuples cleared by Autovacuum since database initialization (only for row-store tables).

last_autovacuum_begin_cu_size

bigint

N/A

Size of the CU file before the latest Autovacuum operation (only for column-store tables)

last_autovacuum_cu_size

bigint

N/A

Size of the CU file after the latest Autovacuum (only for column-store tables)

last_autovacuum_rewrite_size

bigint

N/A

Size of the column-store file last rewritten by autovacuum (only for column-store tables).

last_autovacuum_clear_size

bigint

N/A

Size of the column-store file last cleared by Autovacuum (only for column-store tables).

last_autovacuum_clear_cbtree_tuples

bigint

N/A

Number of cbtree tuples last cleared by Autovacuum (only for column-store tables)

sum_autovacuum_rewrite_size

bigint

N/A

Total size of column-store files rewritten by Autovacuum since database initialization (only for column-store tables).

sum_autovacuum_clear_size

bigint

N/A

Total size of column-store files cleared by Autovacuum since database initialization (only for column-store tables).

sum_autovacuum_clear_cbtree_tuples

bigint

N/A

Total number of cbtree tuples cleared by Autovacuum since database initialization (only for column-store tables).

last_autovacuum_csn

bigint

N/A

If the table-level oldestxmin feature is enabled, this field records the CSN value corresponding to the latest oldestxmin value used by the table (AUTO)VACUUM.

last_automerge_timestamp

timestamp with time zone

N/A

Last automerge time (only for HStore_opt tables). This column is supported only by 9.1.0.100 and later versions.

last_automerge_time_cost

bigint

N/A

Time consumed by the last automerge (only for HStore_opt tables). This column is supported only by 9.1.0.100 and later versions.

last_automerge_count

bigint

N/A

Number of records in the last automerge (only for HStore_opt tables). This column is supported only by 9.1.0.100 and later versions.

extra1

bigint

N/A

Reserved column 1.