Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
20.9. Run-time Statistics
Prev UpChapter 20. Server ConfigurationHome Next

20.9. Run-time Statistics

20.9.1. Query and Index Statistics Collector

These parameters control server-wide statistics collection features. When statistics collection is enabled, the data that is produced can be accessed via thepg_stat andpg_statio family of system views. Refer toChapter 28 for more information.

track_activities (boolean)

Enables the collection of information on the currently executing command of each session, along with its identifier and the time when that command began execution. This parameter is on by default. Note that even when enabled, this information is not visible to all users, only to superusers, roles with privileges of thepg_read_all_stats role and the user owning the sessions being reported on (including sessions belonging to a role they have the privileges of), so it should not represent a security risk. Only superusers can change this setting.

track_activity_query_size (integer)

Specifies the amount of memory reserved to store the text of the currently executing command for each active session, for thepg_stat_activity.query field. If this value is specified without units, it is taken as bytes. The default value is 1024 bytes. This parameter can only be set at server start.

track_counts (boolean)

Enables collection of statistics on database activity. This parameter is on by default, because the autovacuum daemon needs the collected information. Only superusers can change this setting.

track_io_timing (boolean)

Enables timing of database I/O calls. This parameter is off by default, as it will repeatedly query the operating system for the current time, which may cause significant overhead on some platforms. You can use thepg_test_timing tool to measure the overhead of timing on your system. I/O timing information is displayed inpg_stat_database, in the output ofEXPLAIN when theBUFFERS option is used, by autovacuum for auto-vacuums and auto-analyzes, whenlog_autovacuum_min_duration is set and bypg_stat_statements. Only superusers can change this setting.

track_wal_io_timing (boolean)

Enables timing of WAL I/O calls. This parameter is off by default, as it will repeatedly query the operating system for the current time, which may cause significant overhead on some platforms. You can use thepg_test_timing tool to measure the overhead of timing on your system. I/O timing information is displayed inpg_stat_wal. Only superusers can change this setting.

track_functions (enum)

Enables tracking of function call counts and time used. Specifypl to track only procedural-language functions,all to also track SQL and C language functions. The default isnone, which disables function statistics tracking. Only superusers can change this setting.

Note

SQL-language functions that are simple enough to beinlined into the calling query will not be tracked, regardless of this setting.

stats_temp_directory (string)

Sets the directory to store temporary statistics data in. This can be a path relative to the data directory or an absolute path. The default ispg_stat_tmp. Pointing this at a RAM-based file system will decrease physical I/O requirements and can lead to improved performance. This parameter can only be set in thepostgresql.conf file or on the server command line.

20.9.2. Statistics Monitoring

compute_query_id (enum)

Enables in-core computation of a query identifier. Query identifiers can be displayed in thepg_stat_activity view, usingEXPLAIN, or emitted in the log if configured via thelog_line_prefix parameter. Thepg_stat_statements extension also requires a query identifier to be computed. Note that an external module can alternatively be used if the in-core query identifier computation method is not acceptable. In this case, in-core computation must be always disabled. Valid values areoff (always disabled),on (always enabled),auto, which lets modules such aspg_stat_statements automatically enable it, andregress which has the same effect asauto, except that the query identifier is not shown in theEXPLAIN output in order to facilitate automated regression testing. The default isauto.

Note

To ensure that only one query identifier is calculated and displayed, extensions that calculate query identifiers should throw an error if a query identifier has already been computed.

log_statement_stats (boolean)
log_parser_stats (boolean)
log_planner_stats (boolean)
log_executor_stats (boolean)

For each query, output performance statistics of the respective module to the server log. This is a crude profiling instrument, similar to the Unixgetrusage() operating system facility.log_statement_stats reports total statement statistics, while the others report per-module statistics.log_statement_stats cannot be enabled together with any of the per-module options. All of these options are disabled by default. Only superusers can change these settings.


Prev Up Next
20.8. Error Reporting and Logging Home 20.10. Automatic Vacuuming
pdfepub
Go to PostgreSQL 14
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp