Quick onboard
Deployment
Data Modeling
Connecting
Migration
Query
Operations and Maintenance
Common Maintenance
Partition
Backup and Restore
Expansion
Mirroring
Resource Management
Security
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool guide
Data type
Storage Engine
Executor
Stream
DR (Disaster Recovery)
Configuration
Index
Extension
SQL Reference
This document describes the parameters in the system configuration related to the Run-Time Statistics category.
Note!
To ensure system stability and security, manually modifying these parameters should be done with caution.
Sets the default statistics target (number of values stored in the most common values list) for table columns that do not have a column-specific target set via ALTER TABLE ... SET STATISTICS.
| Data Type | Default Value | Range | Setting Classification |
|---|---|---|---|
| int | 100 | 1 ~ 10000 | master; session; reload |
These parameters control server-wide statistics collection features. When statistics collection is enabled, the collected data can be accessed through the pg_stat and pg_statio system view families.
Enables collection of information about the current command being executed by each session, along with the time when the command began execution.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | on | master; session; reload; superuser |
Sets the maximum length limit for query text stored in the current_query column of the system catalog pg_stat_activity.
| Data Type | Default Value | Range | Setting Classification |
|---|---|---|---|
| int | 1024 | 100 ~ 102400 | segment; system; restart |
Controls the collection of statistics about database activity.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload; superuser |
Enables statistics collection on function usage, including call counts and execution time.
pl to track only procedural language functions; specify all to also track SQL and C language functions.none, which disables function statistics tracking.| Data Type | Default Value | Range | Setting Classification |
|---|---|---|---|
| enum | none | none / pl / all | master; session; reload |
Enables timing of system I/O calls.
off because enabling it repeatedly queries the operating system for the current time, which may impose significant overhead on certain platforms.pg_test_timing tool to measure the timing overhead on your system. I/O timing information appears in pg_stat_database, in EXPLAIN output when the BUFFERS option is used, and in pg_stat_io.| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | off | master; session; reload; superuser |
Collects resource queue statistics related to database activity.
stats_queue_level server configuration parameter takes effect only when resource management is set to resource queues.| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | off | master; session; reload |
Sets the directory for storing temporary statistics data.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| string | pg_stat_tmp | segments; system; reload; superuser |
Writes performance statistics of the query executor to the server log for each query.
log_statement_stats.| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | off | segment; system; restart |
Writes performance statistics of the query parser to the server log for each query.
log_statement_stats.| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | off | master; session; reload; superuser |
Writes performance statistics of the Postgres query optimizer (planner) to the server log for each query.
log_statement_stats.| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | off | master; session; reload; superuser |
Writes overall performance statistics from the query parser, optimizer, and execution engine to the server log for each query.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | off | master; session; reload; superuser |
Specifies the mode for triggering automatic statistics collection using ANALYZE.
on_no_stats option triggers statistics collection on any table without statistics after INSERT, UPDATE, or DELETE operations.on_change option triggers statistics collection only when the number of affected rows exceeds the threshold defined by gp_autostats_on_change_threshold. Operations that can trigger automatic statistics collection include: INSERT, UPDATE, DELETE, COPY FROM, and CREATE TABLE AS.on_eager_change option tracks the number of changed rows in a table within the current transaction. If the number of changed rows exceeds a percentage threshold of the total rows in the table (controlled by gp_autostats_eager_threshold, default 0.1 or 10%), automatic statistics collection is triggered.| Data Type | Default Value | Range | Setting Classification |
|---|---|---|---|
| enum | none | none / on_no_stats / on_change / on_eager_change | master; session; reload |
Specifies the mode for triggering automatic statistics collection via ANALYZE statements within procedural language functions.
none option disables statistics collection; the on_no_stats option triggers statistics collection for INSERT, UPDATE, or DELETE operations executed within functions on tables that lack existing statistics.on_change option triggers statistics collection only when the number of affected rows exceeds the threshold defined by gp_autostats_on_change_threshold. Operations that can trigger automatic statistics collection include: INSERT, UPDATE, DELETE, COPY FROM, and CREATE TABLE AS.| Data Type | Default Value | Range | Setting Classification |
|---|---|---|---|
| enum | none | none / on_change / on_no_stats | master; session; reload |
Specifies the threshold for automatic statistics collection when gp_autostats_mode is set to on_change.
ANALYZE is scheduled and statistics are collected.| Data Type | Default Value | Range | Setting Classification |
|---|---|---|---|
| int | 2147483647 | 0 ~ INT_MAX | master; session; reload |
Logs information about automatic ANALYZE operations related to gp_autostats_mode and gp_autostats_mode_in_functions.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | off | master; session; reload; superuser |