System Views

This document introduces selected system views available in SynxDB.

gp_stat_progress_create_index

gp_stat_progress_create_index is a system view that shows real-time progress for ongoing CREATE INDEX or REINDEX operations in the current database.

This view displays detailed status information for each backend process building an index, including the current execution phase, the number of tuples processed, blocks scanned, and more. Once the operation completes, the corresponding entries are automatically removed from the view.

In SynxDB, this view also supports AO (Append-Optimized) tables and can be used to observe the phase-wise progress of index creation on such tables.

Typical use cases include:

  • Monitoring index creation or rebuild operations in real time.

  • Analyzing performance bottlenecks of long-running CREATE INDEX or REINDEX commands.

  • Checking if any index operations are currently consuming system resources.

  • Correlating with gp_stat_activity to trace backend process details.

Example queries:

-- Views all ongoing index creation tasks
SELECT * FROM gp_stat_progress_create_index;

-- Views index progress for a specific table
SELECT * FROM gp_stat_progress_create_index
WHERE relid = 'ao_test'::regclass;

Field

Description

gp_segment_id

ID of the segment where this entry resides. Only applicable in a distributed environment.

pid

Process ID of the backend. Can be joined with gp_stat_activity for session details.

datid

OID of the database, corresponding to pg_database.oid.

datname

Name of the database.

relid

OID of the table being indexed, corresponding to pg_class.oid.

index_relid

OID of the index being built.

command

Type of command being executed: either CREATE INDEX or REINDEX.

phase

Current phase of execution, such as:

  • initializing: Initialization

  • scanning heap: Scanning table data

  • sorting: Sorting phase

  • building index: loading tuples in tree: Building the index structure

  • waiting for locks: Waiting for table or metadata locks

lockers_total

Total number of sessions holding locks (if any).

lockers_done

Number of sessions that have released their locks.

current_locker_pid

Process ID of the session currently holding the lock (if waiting).

blocks_total

Total number of data blocks to scan (might be 0 if unavailable or not started).

blocks_done

Number of data blocks scanned so far.

tuples_total

Estimated total number of tuples to process (if computable).

tuples_done

Number of tuples processed so far.

partitions_total

Total number of partitions (for partitioned tables, if applicable).

partitions_done

Number of partitions processed (if applicable).

Note

  • This view only displays currently running index operations. Entries are removed once the operation completes.

  • For small tables, index creation might complete instantly, and the view might return no rows.

  • To better observe progress, try creating an index on a large table or use complex columns (for example, large text) to slow down execution.

  • Progress is also reported when building indexes on AO (Append-Optimized) tables.

  • You can join this view with gp_stat_activity using the pid field.

    SELECT a.usename, a.query, p.phase, p.blocks_done, p.blocks_total
    FROM gp_stat_activity a
    JOIN gp_stat_progress_create_index p ON a.pid = p.pid;
    

gp_stat_progress_create_index_summary

The gp_stat_progress_create_index_summary view provides a cluster-wide summary of CREATE INDEX or REINDEX operations. It aggregates progress data from all segments, offering a global overview of ongoing index-building tasks.

Field

Data type

Description

pid

integer

Process ID of the leader backend running the index operation.

datid

oid

OID of the database where the operation is running.

datname

name

Name of the database.

relid

oid

OID of the table being indexed.

index_relid

oid

OID of the index being built.

command

text

Type of command being executed: CREATE INDEX or REINDEX.

phase

text

Current processing phase of the CREATE INDEX command across the cluster.

lockers_total

numeric

Total number of sessions holding locks across the cluster (if any).

lockers_done

numeric

Total number of sessions that have released their locks across the cluster.

current_locker_pid

bigint

Process ID of the session currently holding a lock (if waiting).

blocks_total

numeric

Total number of data blocks to scan across the cluster.

blocks_done

numeric

Total number of data blocks scanned so far across the cluster.

tuples_total

numeric

Estimated total number of tuples to process across the cluster.

tuples_done

numeric

Total number of tuples processed so far across the cluster.

partitions_total

numeric

Total number of partitions for partitioned tables across the cluster (if applicable).

partitions_done

numeric

Total number of partitions processed across the cluster (if applicable).

gp_stat_activity

The gp_stat_activity view shows real-time information about all active processes in the database. It is a core tool for monitoring and diagnosing database activity, query performance, and concurrency issues.

In a MPP architecture, this view aggregates process information from the Coordinator node and all segment nodes, providing a global snapshot of activity. By querying this view, database administrators can understand which users are connected, what queries are being executed, the duration of queries, whether processes are in a wait state, and the usage of resource queues.

Compared to PostgreSQL’s pg_stat_activity, gp_stat_activity adds columns such as gp_segment_id, sess_id, leader_pid, and query_id to better reflect query execution in a distributed environment.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment instance where the process is running. -1 represents the Coordinator node, while 0 or a positive number represents the corresponding segment node. This is a specific field for the MPP architecture.

datid

oid

The OID of the database to which the process is connected.

datname

name

The name of the database to which the process is connected.

pid

integer

The operating system process ID of the backend process.

sess_id

integer

The session identifier, used to uniquely identify a user session. The same session has the same sess_id on the coordinator and all segments.

leader_pid

integer

The process ID of the Query Dispatcher for the query execution. If this process is the leader, this field is equal to pid.

usesysid

oid

The OID of the logged-in user.

usename

name

The name of the logged-in user.

application_name

text

The application name set by the client upon connection.

client_addr

inet

The IP address of the client.

client_hostname

text

The hostname of the client (if resolvable).

client_port

integer

The TCP port number the client is using for the connection. -1 indicates it is a local process.

backend_start

timestamp with time zone

The time when the process was started.

xact_start

timestamp with time zone

The time when the current transaction began. NULL if no transaction is active.

query_start

timestamp with time zone

The time when the currently active query began execution.

state_change

timestamp with time zone

The time when the process state was last changed.

wait_event_type

text

The type of event for which the process is waiting, e.g., Lock, LWLock, IO. NULL if the process is not waiting.

wait_event

text

The specific wait event name, e.g., waiting for a specific lock or buffer I/O.

state

text

The current state of the process. Common values include: active (executing a query), idle (idle), idle in transaction (in a transaction but idle), disabled (disabled due to deadlock recovery, etc.).

backend_xid

xid

The top-level transaction identifier of the current backend process, if any.

backend_xmin

xid

The xmin horizon of the current backend process.

query_id

bigint

The unique identifier for the query. Can be used to correlate the same query across views like gp_stat_activity and pg_stat_statement. In an MPP architecture, a query has the same query_id on all segments.

query

text

The text of the query currently being executed by the process.

backend_type

text

The type of the backend process, e.g., client backend, autovacuum worker, background writer.

rsgid

integer

The OID of the resource group to which the process belongs.

rsgname

text

The name of the resource group to which the process belongs.

gp_stat_all_indexes

The gp_stat_all_indexes view displays usage statistics for each index in the database, with data collected from each segment node. This view allows you to see the number of scans, tuples read, and tuples fetched for each index on each segment, providing a basis for analyzing index efficiency and identifying unused indexes.

This view is crucial for performance tuning in a distributed environment. For instance, if an index is heavily used on some segments but rarely or never used on others, it could indicate data skew or an uneven distribution of queries.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

relid

oid

The OID of the table for this index.

indexrelid

oid

The OID of the index itself.

schemaname

name

The name of the schema this index belongs to.

relname

name

The name of the table for this index.

indexrelname

name

The name of the index.

idx_scan

bigint

The number of index scans initiated on this index.

idx_tup_read

bigint

The number of index entries returned by scans on this index.

idx_tup_fetch

bigint

The number of live table rows fetched by simple index scans using this index.

gp_stat_all_indexes_summary

The gp_stat_all_indexes_summary view provides a global summary of usage statistics for each index in the database. It aggregates data from the gp_stat_all_indexes view across all segment nodes, showing the total number of scans and tuples processed for each index across the entire cluster.

This view is very useful for quickly assessing the overall usage of indexes. It can help database administrators identify which indexes are the busiest in the system or which have never been used, thus supporting decisions on index optimization and cleanup.

Field

Data type

Description

relid

oid

The OID of the table for this index.

indexrelid

oid

The OID of the index itself.

schemaname

name

The name of the schema this index belongs to.

relname

name

The name of the table for this index.

indexrelname

name

The name of the index.

idx_scan

numeric

The total number of index scans initiated on this index across the cluster.

idx_tup_read

numeric

The total number of index entries returned by scans on this index across the cluster.

idx_tup_fetch

numeric

The total number of live table rows fetched by simple index scans using this index across the cluster.

gp_stat_all_tables

The gp_stat_all_tables view presents detailed statistics for each table in the database, with data sourced from every segment node. It provides a comprehensive overview of table access (sequential and index scans), tuple activity (inserts, updates, deletes), and maintenance operations (vacuum and analyze).

By using this view, database administrators can gain deep insights into the activity of each table on every segment. This is crucial for identifying hot tables, diagnosing performance bottlenecks, planning maintenance strategies, and detecting issues like data skew.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

relid

oid

The OID of the table.

schemaname

name

The name of the schema the table belongs to.

relname

name

The name of the table.

seq_scan

bigint

The number of sequential scans initiated on this table.

seq_tup_read

bigint

The number of tuples read by sequential scans.

idx_scan

bigint

The number of index scans initiated on this table.

idx_tup_fetch

bigint

The number of tuples fetched by index scans.

n_tup_ins

bigint

The number of tuples inserted into the table.

n_tup_upd

bigint

The number of tuples updated (including HOT updates).

n_tup_del

bigint

The number of tuples deleted.

n_tup_hot_upd

bigint

The number of Heap-Only Tuple (HOT) updates.

n_live_tup

bigint

The estimated number of live tuples.

n_dead_tup

bigint

The estimated number of dead tuples.

n_mod_since_analyze

bigint

The estimated number of tuples modified since this table was last analyzed.

n_ins_since_vacuum

bigint

The number of tuples inserted since this table was last vacuumed.

last_vacuum

timestamp with time zone

The time this table was last manually vacuumed.

last_autovacuum

timestamp with time zone

The time this table was last vacuumed by the autovacuum process.

last_analyze

timestamp with time zone

The time this table was last manually analyzed.

last_autoanalyze

timestamp with time zone

The time this table was last analyzed by the autoanalyze process.

vacuum_count

bigint

The number of times this table has been manually vacuumed.

autovacuum_count

bigint

The number of times this table has been vacuumed by the autovacuum process.

analyze_count

bigint

The number of times this table has been manually analyzed.

autoanalyze_count

bigint

The number of times this table has been analyzed by the autoanalyze process.

gp_stat_all_tables_summary

The gp_stat_all_tables_summary view provides a global summary of usage statistics for each table in the database. It aggregates data from the gp_stat_all_tables view across all segment nodes, showing the total access counts, total tuple activity, and the most recent maintenance operation times for each table across the entire cluster.

This view is useful for quickly assessing the health and activity patterns of tables at a macro level, helping DBAs to rapidly identify the most active or maintenance-needy tables in the cluster.

Field

Data type

Description

relid

oid

The OID of the table.

schemaname

name

The name of the schema the table belongs to.

relname

name

The name of the table.

seq_scan

numeric

The total number of sequential scans initiated on this table across the cluster.

seq_tup_read

numeric

The total number of tuples read by sequential scans across the cluster.

idx_scan

numeric

The total number of index scans initiated on this table across the cluster.

idx_tup_fetch

numeric

The total number of tuples fetched by index scans across the cluster.

n_tup_ins

numeric

The total number of tuples inserted into the table across the cluster.

n_tup_upd

numeric

The total number of tuples updated (including HOT updates) across the cluster.

n_tup_del

numeric

The total number of tuples deleted across the cluster.

n_tup_hot_upd

numeric

The total number of Heap-Only Tuple (HOT) updates across the cluster.

n_live_tup

numeric

The total estimated number of live tuples across the cluster.

n_dead_tup

numeric

The total estimated number of dead tuples across the cluster.

n_mod_since_analyze

numeric

The total estimated number of tuples modified since this table was last analyzed across the cluster.

last_vacuum

timestamp with time zone

The most recent time this table was manually vacuumed across the cluster.

last_autovacuum

timestamp with time zone

The most recent time this table was vacuumed by the autovacuum process across the cluster.

last_analyze

timestamp with time zone

The most recent time this table was manually analyzed across the cluster.

last_autoanalyze

timestamp with time zone

The most recent time this table was analyzed by the autoanalyze process across the cluster.

vacuum_count

bigint

The total number of times this table has been manually vacuumed across the cluster.

autovacuum_count

bigint

The total number of times this table has been vacuumed by the autovacuum process across the cluster.

analyze_count

bigint

The total number of times this table has been manually analyzed across the cluster.

autoanalyze_count

bigint

The total number of times this table has been analyzed by the autoanalyze process across the cluster.

gp_stat_archiver

The gp_stat_archiver view displays status information about the database’s WAL (Write-Ahead Log) archiver process, with data from each segment node. This view allows for monitoring archival activities on each segment, including the number of logs successfully archived, the number of failures, and the time of the last archival, which is critical for database backup and recovery strategies.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

archived_count

bigint

The number of WAL files successfully archived.

last_archived_wal

text

The name of the last WAL file successfully archived.

last_archived_time

timestamp with time zone

The time of the last successful archival.

failed_count

bigint

The number of WAL files that failed to be archived.

last_failed_wal

text

The name of the last WAL file that failed to be archived.

last_failed_time

timestamp with time zone

The time of the last failed archival attempt.

stats_reset

timestamp with time zone

The time at which these statistics were last reset.

gp_stat_archiver_summary

The gp_stat_archiver_summary view provides a summary of the WAL archiver’s status across the entire cluster. It aggregates archival statistics from all segment nodes, allowing DBAs to quickly assess the overall health of the archiving system.

Field

Data type

Description

archived_count

numeric

The total number of WAL files successfully archived across the cluster.

last_archived_wal

text

The name of the last WAL file successfully archived across the cluster.

last_archived_time

timestamp with time zone

The time of the last successful archival across the cluster.

failed_count

numeric

The total number of WAL files that failed to be archived across the cluster.

last_failed_wal

text

The name of the last WAL file that failed to be archived across the cluster.

last_failed_time

timestamp with time zone

The time of the last failed archival attempt across the cluster.

stats_reset

timestamp with time zone

The most recent time at which these statistics were reset across the cluster.

gp_stat_bgwriter

The gp_stat_bgwriter view displays statistics about the activity of the background writer process, with data from each segment node. The background writer is responsible for writing “dirty” shared buffers to disk, reducing the workload for server processes during checkpoints. Monitoring this view helps in understanding the load and efficiency of the I/O system.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

checkpoints_timed

bigint

The number of scheduled checkpoints that have been performed (triggered by timeout).

checkpoints_req

bigint

The number of requested checkpoints that have been performed (triggered by the CHECKPOINT command).

checkpoint_write_time

double precision

The total amount of time, in milliseconds, that has been spent writing buffers to file during checkpoints.

checkpoint_sync_time

double precision

The total amount of time, in milliseconds, that has been spent syncing files to disk during checkpoints.

buffers_checkpoint

bigint

The number of buffers written during checkpoints.

buffers_clean

bigint

The number of buffers written by the background writer.

maxwritten_clean

bigint

The number of times the background writer stopped due to writing too many dirty buffers.

buffers_backend

bigint

The number of buffers written directly by a backend.

buffers_backend_fsync

bigint

The number of times a backend had to execute its own fsync call.

buffers_alloc

bigint

The number of buffers allocated.

stats_reset

timestamp with time zone

The time at which these statistics were last reset.

gp_stat_bgwriter_summary

The gp_stat_bgwriter_summary view provides a summary of the background writer’s activity statistics across the entire cluster. It aggregates data from all segment nodes’ gp_stat_bgwriter views, allowing DBAs to assess the cluster’s I/O performance and checkpoint efficiency from a global perspective.

Field

Data type

Description

checkpoints_timed

numeric

The total number of scheduled checkpoints performed across the cluster (triggered by timeout).

checkpoints_req

numeric

The total number of requested checkpoints performed across the cluster (triggered by the CHECKPOINT command).

checkpoint_write_time

double precision

The total amount of time, in milliseconds, spent writing buffers to file during checkpoints across the cluster.

checkpoint_sync_time

double precision

The total amount of time, in milliseconds, spent syncing files to disk during checkpoints across the cluster.

buffers_checkpoint

numeric

The total number of buffers written during checkpoints across the cluster.

buffers_clean

numeric

The total number of buffers written by the background writer across the cluster.

maxwritten_clean

numeric

The total number of times the background writer stopped due to writing too many dirty buffers across the cluster.

buffers_backend

numeric

The total number of buffers written directly by a backend across the cluster.

buffers_backend_fsync

numeric

The total number of times a backend had to execute its own fsync call across the cluster.

buffers_alloc

numeric

The total number of buffers allocated across the cluster.

stats_reset

timestamp with time zone

The most recent time at which these statistics were reset across the cluster.

gp_stat_database

The gp_stat_database view provides detailed statistics for each database, with data sourced from each segment node. It includes metrics on backend connections, transaction commits and rollbacks, disk block reads and writes, tuple activity, and session timings.

This view allows DBAs to gain in-depth understanding of the load and health of each database on every segment, making it a crucial tool for diagnosing performance issues, analyzing database activity patterns, and planning for capacity.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

datid

oid

The OID of the database.

datname

name

The name of the database.

numbackends

integer

The number of backends currently connected to this database.

xact_commit

bigint

The total number of transactions committed in this database.

xact_rollback

bigint

The total number of transactions rolled back in this database.

blks_read

bigint

The number of disk blocks read.

blks_hit

bigint

The number of times disk blocks were found in the buffer cache.

tup_returned

bigint

The number of tuples returned by queries.

tup_fetched

bigint

The number of tuples fetched by queries.

tup_inserted

bigint

The number of tuples inserted.

tup_updated

bigint

The number of tuples updated.

tup_deleted

bigint

The number of tuples deleted.

conflicts

bigint

The number of queries canceled due to conflicts with recovery.

temp_files

bigint

The number of temporary files created.

temp_bytes

bigint

The total amount of data written to temporary files.

deadlocks

bigint

The number of deadlocks detected.

checksum_failures

bigint

The number of checksum failures detected.

checksum_last_failure

timestamp with time zone

The time of the last checksum failure.

blk_read_time

double precision

The total time spent by backends reading data file blocks, in milliseconds.

blk_write_time

double precision

The total time spent by backends writing data file blocks, in milliseconds.

session_time

double precision

The total time spent by sessions in this database, in milliseconds.

active_time

double precision

The total time spent by sessions executing statements in this database, in milliseconds.

idle_in_transaction_time

double precision

The total time spent by sessions idle in a transaction in this database, in milliseconds.

sessions

bigint

The total number of sessions started in this database.

sessions_abandoned

bigint

The number of sessions that were abandoned.

sessions_fatal

bigint

The number of sessions that experienced a fatal error.

sessions_killed

bigint

The number of sessions terminated by an operator.

stats_reset

timestamp with time zone

The time at which these statistics were last reset.

gp_stat_database_summary

The gp_stat_database_summary view provides a global summary of database activity. It aggregates data from the gp_stat_database view across all segment nodes, showing total connections, transaction volumes, I/O, and tuple activity for each database across the entire cluster.

This view is useful for quickly identifying which databases are the busiest in the system and for assessing overall workload from a high level.

Field

Data type

Description

datid

oid

The OID of the database.

datname

name

The name of the database.

numbackends

bigint

The total number of backends currently connected to this database across the cluster.

xact_commit

bigint

The total number of transactions committed in this database across the cluster.

xact_rollback

bigint

The total number of transactions rolled back in this database across the cluster.

blks_read

numeric

The total number of disk blocks read across the cluster.

blks_hit

numeric

The total number of times disk blocks were found in the buffer cache across the cluster.

tup_returned

numeric

The total number of tuples returned by queries across the cluster.

tup_fetched

numeric

The total number of tuples fetched by queries across the cluster.

tup_inserted

numeric

The total number of tuples inserted across the cluster.

tup_updated

numeric

The total number of tuples updated across the cluster.

tup_deleted

numeric

The total number of tuples deleted across the cluster.

conflicts

bigint

The total number of queries canceled due to conflicts with recovery across the cluster.

temp_files

numeric

The total number of temporary files created across the cluster.

temp_bytes

numeric

The total amount of data written to temporary files across the cluster.

deadlocks

numeric

The total number of deadlocks detected across the cluster.

checksum_failures

numeric

The total number of checksum failures detected across the cluster.

checksum_last_failure

timestamp with time zone

The time of the last checksum failure across the cluster.

blk_read_time

double precision

The total time spent by backends reading data file blocks, in milliseconds, across the cluster.

blk_write_time

double precision

The total time spent by backends writing data file blocks, in milliseconds, across the cluster.

stats_reset

timestamp with time zone

The most recent time at which these statistics were reset across the cluster.

gp_stat_gssapi

The gp_stat_gssapi view shows information about connections authenticated via GSSAPI, with data from each segment node. GSSAPI is a generic interface for security services, often used for authentication systems like Kerberos. This view is essential for monitoring and auditing secure connections.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

pid

integer

The process ID of the backend.

gss_authenticated

boolean

true if the connection was authenticated using GSSAPI.

principal

text

The principal of the client that was authenticated via GSSAPI.

encrypted

boolean

true if the connection is encrypted using GSSAPI.

gp_stat_operations

The gp_stat_operations view provides a log of Data Definition Language (DDL) operations that have occurred on database objects across all segments. It tracks actions such as CREATE, ALTER, and DROP on objects like tables, indexes, and views. This view is useful for auditing DDL changes and understanding the history of object modifications in a distributed environment.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node where the operation was recorded.

classname

text

The system catalog name to which the object belongs (e.g., pg_class for tables, indexes).

objname

name

The name of the object that was operated on.

objid

oid

The OID of the object.

schemaname

name

The name of the schema to which the object belongs.

usestatus

text

The status of the DDL operation (e.g., CREATE, DROP).

usename

name

The name of the user who performed the operation.

actionname

name

The main type of DDL operation (e.g., CREATE TABLE, ALTER VIEW).

subtype

text

A more specific description of the operation subtype (e.g., ADD COLUMN, RENAME).

statime

timestamp with time zone

The time at which the operation was executed.

gp_stat_progress_analyze

The gp_stat_progress_analyze view shows the real-time progress of ANALYZE operations running on the database. It provides detailed, phase-by-phase information for each backend process performing an analysis, including blocks scanned and child table progress. The corresponding entries are removed upon completion of the ANALYZE operation.

Field

Data type

Description

gp_segment_id

integer

ID of the segment where this entry resides.

pid

integer

Process ID of the backend running ANALYZE.

datid

oid

OID of the database where the operation is running.

datname

name

Name of the database.

relid

oid

OID of the table being analyzed.

phase

text

Current processing phase of the ANALYZE command. Phases include initializing, acquiring sample rows, computing statistics, finalizing analyze.

sample_blks_total

bigint

Total number of blocks to be sampled from the table.

sample_blks_scanned

bigint

Number of blocks sampled so far.

ext_stats_total

bigint

Total number of extended statistics targets to compute.

ext_stats_computed

bigint

Number of extended statistics targets computed so far.

child_tables_total

bigint

Total number of child tables to be processed (for partitioned tables).

child_tables_done

bigint

Number of child tables processed so far.

current_child_table_relid

oid

OID of the child table currently being processed (if any).

gp_stat_progress_analyze_summary

The gp_stat_progress_analyze_summary view provides a cluster-wide summary of ANALYZE operations. It aggregates the progress data from all segments, offering a global overview of ongoing analysis tasks. This is particularly useful for monitoring the overall progress on large partitioned tables.

Field

Data type

Description

pid

integer

Process ID of the leader backend running ANALYZE.

datid

oid

OID of the database where the operation is running.

datname

name

Name of the database.

relid

oid

OID of the table being analyzed.

phase

text

Current processing phase of the ANALYZE command across the cluster.

sample_blks_total

numeric

Total number of blocks to be sampled across all segments.

sample_blks_scanned

numeric

Total number of blocks sampled so far across all segments.

ext_stats_total

numeric

Total number of extended statistics targets to compute across all segments.

ext_stats_computed

numeric

Total number of extended statistics targets computed so far across all segments.

child_tables_total

numeric

Total number of child tables to be processed across all segments.

child_tables_done

numeric

Total number of child tables processed so far across all segments.

gp_stat_progress_basebackup

The gp_stat_progress_basebackup view monitors the progress of a physical base backup being taken. This view is essential for DBAs to track the real-time status of backup operations, ensuring that data is being streamed correctly and estimating completion times.

Field

Data type

Description

gp_segment_id

integer

ID of the segment from which the backup data is being streamed.

pid

integer

Process ID of the backend performing the base backup.

phase

text

Current phase of the backup process. Phases can be waiting for checkpoint to finish, estimating backup size, streaming database files, waiting for WAL archiving to finish, transferring WAL files.

backup_total

bigint

The total amount of data to be backed up, in bytes.

backup_streamed

bigint

The amount of data that has been streamed so far, in bytes.

tablespaces_total

bigint

The total number of tablespaces to be backed up.

tablespaces_streamed

bigint

The number of tablespaces that have been streamed so far.

gp_stat_progress_cluster

The gp_stat_progress_cluster view reports the progress of CLUSTER and VACUUM FULL operations. It provides a detailed look into the progress on each segment, showing how much of the table has been processed.

Field

Data type

Description

gp_segment_id

integer

ID of the segment where the operation is running.

pid

integer

Process ID of the backend performing the operation.

datid

oid

OID of the database.

datname

name

Name of the database.

relid

oid

OID of the table being clustered or vacuumed.

command

text

The command being executed (CLUSTER or VACUUM FULL).

phase

text

Current phase of the operation, e.g., scanning heap, sorting, writing new table.

cluster_index_relid

oid

OID of the index being used for clustering, if any.

heap_tuples_scanned

bigint

Number of tuples scanned from the original table.

heap_tuples_written

bigint

Number of tuples written to the new table.

heap_blks_total

bigint

Total number of heap blocks in the table.

heap_blks_scanned

bigint

Number of heap blocks scanned so far.

index_rebuild_count

bigint

Number of indexes that have been rebuilt.

gp_stat_progress_cluster_summary

The gp_stat_progress_cluster_summary view provides a cluster-wide summary of CLUSTER and VACUUM FULL operations. It aggregates the progress from all segments to give a global overview.

Field

Data type

Description

pid

integer

Process ID of the leader backend for the operation.

datid

oid

OID of the database.

datname

name

Name of the database.

relid

oid

OID of the table being processed.

command

text

The command being executed (CLUSTER or VACUUM FULL).

phase

text

Current phase of the operation across the cluster.

cluster_index_relid

oid

OID of the index being used for clustering, if any.

heap_tuples_scanned

numeric

Total number of tuples scanned across all segments.

heap_tuples_written

numeric

Total number of tuples written across all segments.

heap_blks_total

numeric

Total number of heap blocks across all segments.

heap_blks_scanned

numeric

Total number of heap blocks scanned across all segments.

index_rebuild_count

numeric

Total number of indexes rebuilt across all segments.

gp_stat_progress_copy

The gp_stat_progress_copy view provides real-time progress for COPY commands. It is particularly useful for monitoring large data loading operations, showing bytes and tuples processed.

Field

Data type

Description

gp_segment_id

integer

ID of the segment where the COPY operation is running.

pid

integer

Process ID of the backend executing the COPY command.

datid

oid

OID of the database.

datname

name

Name of the database.

relid

oid

OID of the table being copied to or from.

command

text

The COPY command being executed (e.g., COPY FROM, COPY TO).

type

text

The source or destination type (e.g., FILE, PROGRAM).

bytes_processed

bigint

Number of bytes processed so far.

bytes_total

bigint

Total number of bytes to be processed (if known).

tuples_processed

bigint

Number of tuples (rows) processed so far.

tuples_excluded

bigint

Number of tuples excluded due to WHERE clause conditions (for COPY FROM).

gp_stat_progress_vacuum_summary

The gp_stat_progress_vacuum_summary view provides a cluster-wide summary of VACUUM operations. It aggregates progress data from all segments, offering a global overview of ongoing vacuum tasks, which is especially useful for monitoring the maintenance progress on large, distributed tables.

Field

Data type

Description

pid

integer

Process ID of the leader backend running VACUUM.

datid

oid

OID of the database where the operation is running.

datname

name

Name of the database.

relid

oid

OID of the table being vacuumed.

phase

text

Current processing phase of the VACUUM command across the cluster, e.g., scanning heap, vacuuming indexes, truncating heap.

heap_blks_total

numeric

Total number of heap blocks in the table across the cluster.

heap_blks_scanned

numeric

Total number of heap blocks scanned so far across the cluster.

heap_blks_vacuumed

numeric

Total number of heap blocks vacuumed so far across the cluster.

index_vacuum_count

numeric

Total number of indexes vacuumed so far across the cluster.

max_dead_tuples

numeric

The total maximum number of dead tuples that the autovacuum worker expects to find across the cluster.

num_dead_tuples

numeric

The total number of dead tuples removed so far across the cluster.

gp_stat_slru_summary

The gp_stat_slru_summary view provides summary statistics for “Simple Least Recently Used” (SLRU) caches across the entire cluster. SLRU caches are used to manage data that does not fit in the main shared buffers, such as transaction status (e.g., Commit Log). This view helps in monitoring the performance and I/O of these critical internal caches.

Field

Data type

Description

name

text

Name of the SLRU cache (e.g., CommitLog, Subtrans).

blks_zeroed

numeric

Total number of blocks zeroed out during creation across the cluster.

blks_hit

numeric

Total number of times a block was found in the SLRU cache, avoiding a disk read, across the cluster.

blks_read

numeric

Total number of blocks read from disk for this cache across the cluster.

blks_written

numeric

Total number of blocks written to disk for this cache across the cluster.

blks_exists

numeric

Total number of blocks that already existed on disk when a write was attempted (write was skipped) across the cluster.

flushes

numeric

Total number of times the cache was flushed to disk across the cluster.

truncates

numeric

Total number of times the cache was truncated across the cluster.

stats_reset

timestamp with time zone

The most recent time at which these statistics were reset across the cluster.

gp_stat_sys_indexes_summary

The gp_stat_sys_indexes_summary view provides a global summary of usage statistics for system catalog indexes. It aggregates data from the gp_stat_sys_indexes view across all segment nodes, showing the total number of scans and tuples processed for each system index across the entire cluster.

This view is important for monitoring and tuning the performance of internal database operations, as it can help identify inefficient or unused indexes on system catalogs.

Field

Data type

Description

relid

oid

The OID of the system table for this index.

indexrelid

oid

The OID of the index itself.

schemaname

name

The name of the schema this index belongs to (usually pg_catalog).

relname

name

The name of the system table for this index.

indexrelname

name

The name of the index.

idx_scan

numeric

The total number of index scans initiated on this index across the cluster.

idx_tup_read

numeric

The total number of index entries returned by scans on this index across the cluster.

idx_tup_fetch

numeric

The total number of live table rows fetched by simple index scans using this index across the cluster.

gp_stat_sys_tables_summary

The gp_stat_sys_tables_summary view provides a global summary of activity on system catalog tables. It aggregates data from the gp_stat_sys_tables view across all segment nodes, showing the total access counts, tuple activity, and the most recent maintenance operation times for each system table across the entire cluster.

This view is useful for quickly assessing the health and activity patterns of system tables at a macro level, helping DBAs to rapidly identify the most active or maintenance-needy system tables in the cluster.

Field

Data type

Description

relid

oid

The OID of the system table.

schemaname

name

The name of the schema the system table belongs to (usually pg_catalog).

relname

name

The name of the system table.

seq_scan

numeric

The total number of sequential scans initiated on this system table across the cluster.

seq_tup_read

numeric

The total number of tuples read by sequential scans across the cluster.

idx_scan

numeric

The total number of index scans initiated on this system table across the cluster.

idx_tup_fetch

numeric

The total number of tuples fetched by index scans across the cluster.

n_tup_ins

numeric

The total number of tuples inserted into this system table across the cluster.

n_tup_upd

numeric

The total number of tuples updated (including HOT updates) across the cluster.

n_tup_del

numeric

The total number of tuples deleted across the cluster.

n_tup_hot_upd

numeric

The total number of Heap-Only Tuple (HOT) updates across the cluster.

n_live_tup

numeric

The total estimated number of live tuples across the cluster.

n_dead_tup

numeric

The total estimated number of dead tuples across the cluster.

n_mod_since_analyze

numeric

The total estimated number of tuples modified since this table was last analyzed across the cluster.

last_vacuum

timestamp with time zone

The most recent time this system table was manually vacuumed across the cluster.

last_autovacuum

timestamp with time zone

The most recent time this system table was vacuumed by the autovacuum process across the cluster.

last_analyze

timestamp with time zone

The most recent time this system table was manually analyzed across the cluster.

last_autoanalyze

timestamp with time zone

The most recent time this system table was analyzed by the autoanalyze process across the cluster.

vacuum_count

bigint

The total number of times this system table has been manually vacuumed across the cluster.

autovacuum_count

bigint

The total number of times this system table has been vacuumed by the autovacuum process across the cluster.

analyze_count

bigint

The total number of times this system table has been manually analyzed across the cluster.

autoanalyze_count

bigint

The total number of times this system table has been analyzed by the autoanalyze process across the cluster.

gp_stat_user_functions_summary

The gp_stat_user_functions_summary view provides a global summary of execution statistics for user-defined functions. It shows the total number of calls, total execution time, and the self-execution time (time spent in the function itself, excluding other functions it calls) for each function.

This view is useful for identifying the most time-consuming or frequently called functions, making it a key tool for function-level performance optimization.

Field

Data type

Description

funcid

oid

The OID of the function.

schemaname

name

The name of the schema the function belongs to.

funcname

name

The name of the function.

calls

numeric

The total number of times the function has been called.

total_time

double precision

The total time spent in the function and other functions called by it, in milliseconds.

self_time

double precision

The time spent in the function itself, excluding other functions it calls, in milliseconds.

gp_stat_user_indexes

The gp_stat_user_indexes view displays usage statistics for each index on user tables across each segment. It is similar to gp_stat_all_indexes but exclusively includes indexes on user tables, excluding those on system catalogs.

This view allows you to see the number of scans, tuples read, and tuples fetched for each user index on each segment, providing a basis for analyzing the efficiency of user table indexes and identifying unused ones.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

relid

oid

The OID of the table for this index.

indexrelid

oid

The OID of the index itself.

schemaname

name

The name of the schema this index belongs to.

relname

name

The name of the table for this index.

indexrelname

name

The name of the index.

idx_scan

bigint

The number of index scans initiated on this index.

idx_tup_read

bigint

The number of index entries returned by scans on this index.

idx_tup_fetch

bigint

The number of live table rows fetched by simple index scans using this index.

gp_stat_user_indexes_summary

The gp_stat_user_indexes_summary view provides a global summary of usage statistics for user table indexes. It aggregates data from the gp_stat_user_indexes view across all segment nodes, showing the total number of scans and tuples processed for each user index across the entire cluster.

This view is useful for quickly assessing the overall usage of user indexes, helping database administrators identify which indexes are the busiest or which have never been used, thus supporting decisions on index optimization and cleanup.

Field

Data type

Description

relid

oid

The OID of the table for this index.

indexrelid

oid

The OID of the index itself.

schemaname

name

The name of the schema this index belongs to.

relname

name

The name of the table for this index.

indexrelname

name

The name of the index.

idx_scan

numeric

The total number of index scans initiated on this index across the cluster.

idx_tup_read

numeric

The total number of index entries returned by scans on this index across the cluster.

idx_tup_fetch

numeric

The total number of live table rows fetched by simple index scans using this index across the cluster.

gp_stat_wal_summary

The gp_stat_wal_summary view provides a summary of Write-Ahead Log (WAL) activity across the entire cluster. It aggregates data from the gp_stat_wal view across all segment nodes, showing the overall picture of WAL record generation, writes, and syncs.

This view is crucial for monitoring the I/O performance of the cluster and diagnosing WAL-related bottlenecks.

Field

Data type

Description

wal_records

numeric

Total number of WAL records generated across the cluster.

wal_fpw

numeric

Total number of full page writes (FPWs) made across the cluster.

wal_bytes

numeric

Total number of bytes of WAL generated across the cluster.

wal_buffers_full

numeric

Total number of times WAL buffers were written to disk because they became full across the cluster.

wal_write

numeric

Total number of times WAL buffers were written to disk across the cluster.

wal_sync

numeric

Total number of times WAL files were synced to disk across the cluster.

wal_write_time

double precision

Total time spent writing WAL files, in milliseconds, across the cluster.

wal_sync_time

double precision

Total time spent syncing WAL files, in milliseconds, across the cluster.

stats_reset

timestamp with time zone

The most recent time at which these statistics were reset across the cluster.

gp_stat_xact_all_tables

The gp_stat_xact_all_tables view shows statistics about operations on each table within the current transaction, with data from each segment node. It only displays changes made by the current backend process in the current transaction.

This view is useful for understanding and diagnosing the behavior of specific transactions, helping to analyze table access patterns and resource consumption during a transaction.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

relid

oid

The OID of the table.

schemaname

name

The name of the schema the table belongs to.

relname

name

The name of the table.

seq_scan

bigint

The number of sequential scans initiated on this table in the current transaction.

seq_tup_read

bigint

The number of tuples read by sequential scans in the current transaction.

idx_scan

bigint

The number of index scans initiated on this table in the current transaction.

idx_tup_fetch

bigint

The number of tuples fetched by index scans in the current transaction.

n_tup_ins

bigint

The number of tuples inserted into the table in the current transaction.

n_tup_upd

bigint

The number of tuples updated (including HOT updates) in the current transaction.

n_tup_del

bigint

The number of tuples deleted in the current transaction.

n_tup_hot_upd

bigint

The number of Heap-Only Tuple (HOT) updates in the current transaction.

gp_stat_xact_all_tables_summary

The gp_stat_xact_all_tables_summary view provides a global summary of activity for all tables within the current transaction. It aggregates data from the gp_stat_xact_all_tables view across all segment nodes, showing the total access and tuple activity for each table across the entire cluster.

This view is useful for quickly understanding the impact of the current transaction on various tables at a macro level.

Field

Data type

Description

relid

oid

The OID of the table.

schemaname

name

The name of the schema the table belongs to.

relname

name

The name of the table.

seq_scan

numeric

The total number of sequential scans initiated on this table in the current transaction across the cluster.

seq_tup_read

numeric

The total number of tuples read by sequential scans in the current transaction across the cluster.

idx_scan

numeric

The total number of index scans initiated on this table in the current transaction across the cluster.

idx_tup_fetch

numeric

The total number of tuples fetched by index scans in the current transaction across the cluster.

n_tup_ins

numeric

The total number of tuples inserted into the table in the current transaction across the cluster.

n_tup_upd

numeric

The total number of tuples updated (including HOT updates) in the current transaction across the cluster.

n_tup_del

numeric

The total number of tuples deleted in the current transaction across the cluster.

n_tup_hot_upd

numeric

The total number of Heap-Only Tuple (HOT) updates in the current transaction across the cluster.

gp_stat_xact_sys_tables_summary

The gp_stat_xact_sys_tables_summary view provides a global summary of activity on system catalog tables within the current transaction. It aggregates data from the gp_stat_xact_sys_tables view across all segment nodes, showing the total access and tuple activity for each system table across the entire cluster.

This view is useful for understanding the impact of the current transaction on internal system catalogs.

Field

Data type

Description

relid

oid

The OID of the system table.

schemaname

name

The name of the schema the system table belongs to.

relname

name

The name of the system table.

seq_scan

numeric

The total number of sequential scans initiated on this system table in the current transaction across the cluster.

seq_tup_read

numeric

The total number of tuples read by sequential scans in the current transaction across the cluster.

idx_scan

numeric

The total number of index scans initiated on this system table in the current transaction across the cluster.

idx_tup_fetch

numeric

The total number of tuples fetched by index scans in the current transaction across the cluster.

n_tup_ins

numeric

The total number of tuples inserted into this system table in the current transaction across the cluster.

n_tup_upd

numeric

The total number of tuples updated (including HOT updates) in the current transaction across the cluster.

n_tup_del

numeric

The total number of tuples deleted in the current transaction across the cluster.

n_tup_hot_upd

numeric

The total number of Heap-Only Tuple (HOT) updates in the current transaction across the cluster.

gp_stat_xact_user_functions_summary

The gp_stat_xact_user_functions_summary view provides a global summary of execution statistics for user-defined functions within the current transaction. It shows the total number of calls, total execution time, and self-execution time for each function.

This view is useful for identifying the most expensive or frequently called functions within the current transaction, making it a key tool for function-level performance optimization.

Field

Data type

Description

funcid

oid

The OID of the function.

schemaname

name

The name of the schema the function belongs to.

funcname

name

The name of the function.

calls

numeric

The total number of times the function has been called in the current transaction.

total_time

double precision

The total time spent in the function and other functions called by it, in milliseconds, in the current transaction.

self_time

double precision

The time spent in the function itself, excluding other functions it calls, in milliseconds, in the current transaction.

gp_stat_xact_user_tables_summary

The gp_stat_xact_user_tables_summary view provides a global summary of activity on user tables within the current transaction. It aggregates data from the gp_stat_xact_user_tables view across all segment nodes, showing the total access and tuple activity for each user table across the entire cluster.

This view is useful for quickly understanding the impact of the current transaction on various user tables at a macro level.

Field

Data type

Description

relid

oid

The OID of the user table.

schemaname

name

The name of the schema the user table belongs to.

relname

name

The name of the user table.

seq_scan

numeric

The total number of sequential scans initiated on this user table in the current transaction across the cluster.

seq_tup_read

numeric

The total number of tuples read by sequential scans in the current transaction across the cluster.

idx_scan

numeric

The total number of index scans initiated on this user table in the current transaction across the cluster.

idx_tup_fetch

numeric

The total number of tuples fetched by index scans in the current transaction across the cluster.

n_tup_ins

numeric

The total number of tuples inserted into this user table in the current transaction across the cluster.

n_tup_upd

numeric

The total number of tuples updated (including HOT updates) in the current transaction across the cluster.

n_tup_del

numeric

The total number of tuples deleted in the current transaction across the cluster.

n_tup_hot_upd

numeric

The total number of Heap-Only Tuple (HOT) updates in the current transaction across the cluster.

gp_statio_all_indexes

The gp_statio_all_indexes view provides I/O statistics for each index, with data from each segment node. It includes metrics on disk block reads and buffer hits, which are crucial for evaluating the I/O efficiency of indexes.

By using this view, DBAs can gain deep insights into the I/O activity of each index on every segment, making it an important tool for diagnosing index-related I/O performance issues.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

relid

oid

The OID of the table for this index.

indexrelid

oid

The OID of the index itself.

schemaname

name

The name of the schema this index belongs to.

relname

name

The name of the table for this index.

indexrelname

name

The name of the index.

idx_blks_read

bigint

The number of disk blocks read for this index.

idx_blks_hit

bigint

The number of buffer hits in this index.

gp_statio_all_indexes_summary

The gp_statio_all_indexes_summary view provides a global summary of I/O activity for all indexes. It aggregates data from the gp_statio_all_indexes view across all segment nodes, showing the total disk block reads and buffer hits for each index across the entire cluster.

This view is useful for quickly assessing the I/O efficiency of indexes at a macro level.

Field

Data type

Description

relid

oid

The OID of the table for this index.

indexrelid

oid

The OID of the index itself.

schemaname

name

The name of the schema this index belongs to.

relname

name

The name of the table for this index.

indexrelname

name

The name of the index.

idx_blks_read

numeric

The total number of disk blocks read for this index across the cluster.

idx_blks_hit

numeric

The total number of buffer hits in this index’s buffer cache across the cluster.

gp_statio_all_sequences

The gp_statio_all_sequences view provides I/O statistics for each sequence, with data from each segment node. It includes metrics on disk block reads and buffer hits, which are crucial for evaluating the I/O efficiency of sequences.

By using this view, DBAs can gain deep insights into the I/O activity of each sequence on every segment, making it an important tool for diagnosing sequence-related I/O performance issues.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

relid

oid

The OID of the sequence.

schemaname

name

The name of the schema the sequence belongs to.

relname

name

The name of the sequence.

blks_read

bigint

The number of disk blocks read for this sequence.

blks_hit

bigint

The number of buffer hits in this sequence’s buffer cache.

gp_statio_all_sequences_summary

The gp_statio_all_sequences_summary view provides a global summary of I/O activity for all sequences. It aggregates data from the gp_statio_all_sequences view across all segment nodes, showing the total disk block reads and buffer hits for each sequence across the entire cluster.

This view is useful for quickly assessing the I/O efficiency of sequences at a macro level.

Field

Data type

Description

relid

oid

The OID of the sequence.

schemaname

name

The name of the schema the sequence belongs to.

relname

name

The name of the sequence.

blks_read

numeric

The total number of disk blocks read for this sequence across the cluster.

blks_hit

numeric

The total number of buffer hits in this sequence’s buffer cache across the cluster.

gp_statio_all_tables_summary

The gp_statio_all_tables_summary view provides a global summary of I/O activity for all tables. It aggregates data from the gp_statio_all_tables view across all segment nodes, showing the total disk block reads and buffer hits for each table across the entire cluster.

This view is useful for quickly assessing the I/O efficiency of tables at a macro level.

Field

Data type

Description

relid

oid

The OID of the table.

schemaname

name

The name of the schema the table belongs to.

relname

name

The name of the table.

heap_blks_read

numeric

The total number of heap disk blocks read for this table across the cluster.

heap_blks_hit

numeric

The total number of buffer hits in this table’s heap buffer cache across the cluster.

idx_blks_read

numeric

The total number of disk blocks read for all indexes on this table across the cluster.

idx_blks_hit

numeric

The total number of buffer hits in all indexes on this table across the cluster.

toast_blks_read

numeric

The total number of disk blocks read for this table’s TOAST table across the cluster.

toast_blks_hit

numeric

The total number of buffer hits in this table’s TOAST table buffer cache across the cluster.

tidx_blks_read

numeric

The total number of disk blocks read for this table’s TOAST table index across the cluster.

tidx_blks_hit

numeric

The total number of buffer hits in this table’s TOAST table index buffer cache across the cluster.

gp_statio_sys_indexes_summary

The gp_statio_sys_indexes_summary view provides a global summary of I/O activity for system catalog indexes. It aggregates data from the gp_statio_sys_indexes view across all segment nodes, showing the total disk block reads and buffer hits for each system index across the entire cluster.

This view is useful for quickly assessing the I/O efficiency of system indexes at a macro level.

Field

Data type

Description

relid

oid

The OID of the system table for this index.

indexrelid

oid

The OID of the index itself.

schemaname

name

The name of the schema this index belongs to.

relname

name

The name of the system table for this index.

indexrelname

name

The name of the index.

idx_blks_read

numeric

The total number of disk blocks read for this index across the cluster.

idx_blks_hit

numeric

The total number of buffer hits in this index’s buffer cache across the cluster.

gp_statio_sys_sequences_summary

The gp_statio_sys_sequences_summary view provides a global summary of I/O activity for system sequences. It aggregates data from the gp_statio_sys_sequences view across all segment nodes, showing the total disk block reads and buffer hits for each system sequence across the entire cluster.

This view is useful for quickly assessing the I/O efficiency of system sequences at a macro level.

Field

Data type

Description

relid

oid

The OID of the system sequence.

schemaname

name

The name of the schema the system sequence belongs to.

relname

name

The name of the system sequence.

blks_read

numeric

The total number of disk blocks read for this system sequence across the cluster.

blks_hit

numeric

The total number of buffer hits in this system sequence’s buffer cache across the cluster.

gp_statio_sys_tables_summary

The gp_statio_sys_tables_summary view provides a global summary of I/O activity for system tables. It aggregates data from the gp_statio_sys_tables view across all segment nodes, showing the total disk block reads and buffer hits for each system table across the entire cluster.

This view is useful for quickly assessing the I/O efficiency of system tables at a macro level.

Field

Data type

Description

relid

oid

The OID of the system table.

schemaname

name

The name of the schema the system table belongs to.

relname

name

The name of the system table.

heap_blks_read

numeric

The total number of heap disk blocks read for this system table across the cluster.

heap_blks_hit

numeric

The total number of buffer hits in this system table’s heap buffer cache across the cluster.

idx_blks_read

numeric

The total number of disk blocks read for all indexes on this system table across the cluster.

idx_blks_hit

numeric

The total number of buffer hits in all indexes on this system table across the cluster.

toast_blks_read

numeric

The total number of disk blocks read for this system table’s TOAST table across the cluster.

toast_blks_hit

numeric

The total number of buffer hits in this system table’s TOAST table buffer cache across the cluster.

tidx_blks_read

numeric

The total number of disk blocks read for this system table’s TOAST table index across the cluster.

tidx_blks_hit

numeric

The total number of buffer hits in this system table’s TOAST table index buffer cache across the cluster.

gp_statio_user_indexes_summary

The gp_statio_user_indexes_summary view provides a global summary of I/O activity for user indexes. It aggregates data from the gp_statio_user_indexes view across all segment nodes, showing the total disk block reads and buffer hits for each user index across the entire cluster.

This view is useful for quickly assessing the I/O efficiency of user indexes at a macro level.

Field

Data type

Description

relid

oid

The OID of the user table for this index.

indexrelid

oid

The OID of the index itself.

schemaname

name

The name of the schema this index belongs to.

relname

name

The name of the user table for this index.

indexrelname

name

The name of the index.

idx_blks_read

numeric

The total number of disk blocks read for this index across the cluster.

idx_blks_hit

numeric

The total number of buffer hits in this index’s buffer cache across the cluster.

gp_statio_user_sequences_summary

The gp_statio_user_sequences_summary view provides a global summary of I/O activity for user sequences. It aggregates data from the gp_statio_user_sequences view across all segment nodes, showing the total disk block reads and buffer hits for each user sequence across the entire cluster.

This view is useful for quickly assessing the I/O efficiency of user sequences at a macro level.

Field

Data type

Description

relid

oid

The OID of the user sequence.

schemaname

name

The name of the schema the user sequence belongs to.

relname

name

The name of the user sequence.

blks_read

numeric

The total number of disk blocks read for this user sequence across the cluster.

blks_hit

numeric

The total number of buffer hits in this user sequence’s buffer cache across the cluster.

gp_statio_user_tables

The gp_statio_user_tables view provides I/O statistics for each user table, with data from each segment node. It includes metrics on disk block reads and buffer hits for heaps, indexes, and TOAST tables, which are crucial for evaluating the I/O efficiency of user tables.

By using this view, DBAs can gain deep insights into the I/O activity of each user table on every segment, making it an important tool for diagnosing table-related I/O performance issues. This view includes only user tables, excluding system tables.

Field

Data type

Description

gp_segment_id

integer

The ID of the segment node to which this record belongs.

relid

oid

The OID of the table.

schemaname

name

The name of the schema the table belongs to.

relname

name

The name of the table.

heap_blks_read

bigint

The number of disk blocks read from this table’s heap.

heap_blks_hit

bigint

The number of buffer hits in this table’s heap.

idx_blks_read

bigint

The number of disk blocks read from all indexes on this table.

idx_blks_hit

bigint

The number of buffer hits in all indexes on this table.

toast_blks_read

bigint

The number of disk blocks read from this table’s TOAST table.

toast_blks_hit

bigint

The number of buffer hits in this table’s TOAST table.

tidx_blks_read

bigint

The number of disk blocks read from this table’s TOAST table index.

tidx_blks_hit

bigint

The number of buffer hits in this table’s TOAST table index.

gp_stat_user_tables_summary

The gp_stat_user_tables_summary view provides a global summary of activity on user tables. It aggregates data from the gp_stat_user_tables view across all segment nodes, showing total access counts, tuple activity, and the most recent maintenance operation times for each user table across the entire cluster.

This view is useful for quickly assessing the health and activity patterns of user tables at a macro level, helping DBAs to rapidly identify the most active or maintenance-needy user tables in the cluster.

Field

Data type

Description

relid

oid

The OID of the user table.

schemaname

name

The name of the schema the user table belongs to.

relname

name

The name of the user table.

seq_scan

numeric

The total number of sequential scans initiated on this user table across the cluster.

seq_tup_read

numeric

The total number of tuples read by sequential scans across the cluster.

idx_scan

numeric

The total number of index scans initiated on this user table across the cluster.

idx_tup_fetch

numeric

The total number of tuples fetched by index scans across the cluster.

n_tup_ins

numeric

The total number of tuples inserted into this user table across the cluster.

n_tup_upd

numeric

The total number of tuples updated (including HOT updates) across the cluster.

n_tup_del

numeric

The total number of tuples deleted in the current transaction across the cluster.

n_tup_hot_upd

numeric

The total number of Heap-Only Tuple (HOT) updates across the cluster.

n_live_tup

numeric

The total estimated number of live tuples across the cluster.

n_dead_tup

numeric

The total estimated number of dead tuples across the cluster.

n_mod_since_analyze

numeric

The total estimated number of tuples modified since this table was last analyzed across the cluster.

last_vacuum

timestamp with time zone

The most recent time this user table was manually vacuumed across the cluster.

last_autovacuum

timestamp with time zone

The most recent time this user table was vacuumed by the autovacuum process across the cluster.

last_analyze

timestamp with time zone

The most recent time this user table was manually analyzed across the cluster.

last_autoanalyze

timestamp with time zone

The most recent time this user table was analyzed by the autoanalyze process across the cluster.

vacuum_count

bigint

The total number of times this user table has been manually vacuumed across the cluster.

autovacuum_count

bigint

The total number of times this user table has been vacuumed by the autovacuum process across the cluster.

analyze_count

bigint

The total number of times this user table has been manually analyzed across the cluster.

autoanalyze_count

bigint

The total number of times this user table has been analyzed by the autoanalyze process across the cluster.