Updated on 2024-06-03 GMT+08:00

GS_TABLESTATS_HISTORY

GS_TABLESTATS_HISTORY is a table for managing historical statistics at the table, index, and partition levels. It stores historical statistics about tables, indexes, and partitions in a database.

Table 1 GS_TABLESTATS_HISTORY columns

Name

Type

Description

relid

oid

Unique identifier of a table, index, or partition in pg_class/pg_partition.

relname

name

Name of a table, index, or partition.

relnamespace

oid

OID of the namespace that contains this object.

relkind

"char"

Object type.

  • r: ordinary table.
  • I: table-level index.
  • i: partitioned index.
  • p: level-1 partition.
  • s: level-2 partition.

reltimestamp

timestamp with time zone

Time when the statistics are collected.

relpages

double precision

Size of the table on disk in pages. This is only an estimate used by the optimizer.

reltuples

double precision

Number of rows in the table. This is only an estimate used by the optimizer.

relallvisible

integer

Number of pages marked as all visible in the table.