Statistics collector
The statistics collector
is a subsystem which collects information about activity on the local server, such as table/index access and vacuum/analyze activity.
From PostgreSQL 15, the statistics collector
is no longer a separate subsystem, and has been replaced by a purely in-memory implementation directly integrated into the core system.
Information gathered by the statistics collector is made available via the various pg_stat_* / pg_statio_*
views.
Note that these kinds of statistics are specific to the local server and are not replicated. They should not be confused with the statistics on data collected by analyze
operations and stored in pg_statistic
et al, which are replicated.
Configuration
The following configuration parameters are relevant for the statistics collector
:
track_activities
track_activity_query_size
track_counts
track_functions
track_io_timing
stats_temp_directory
(PostgreSQL 14 and earlier)stats_fetch_consistency
(PostgreSQL 15 and later)
Change history
Work-in-progress
- PostgreSQL 15
- replaced by shared memory implementation (commit 5891c7a8)
stats_temp_directory
removed (commit 6f0cf878)
References
- PostgreSQL documentation: The Statistics Collector
- PostgreSQL documentation: Query and Index Statistics Collector
Useful links
- PostgreSQL 15: Stats Collector Gone? What’s New? - August 2022 blog article by Jobin Augustine / Percona