]> begriffs open source - ai-pg/blob - full-docs/txt/runtime-config-statistics.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / runtime-config-statistics.txt
1
2 19.9. Run-time Statistics #
3
4    19.9.1. Cumulative Query and Index Statistics
5    19.9.2. Statistics Monitoring
6
7 19.9.1. Cumulative Query and Index Statistics #
8
9    These parameters control the server-wide cumulative statistics system.
10    When enabled, the data that is collected can be accessed via the
11    pg_stat and pg_statio family of system views. Refer to Chapter 27 for
12    more information.
13
14    track_activities (boolean) #
15           Enables the collection of information on the currently executing
16           command of each session, along with its identifier and the time
17           when that command began execution. This parameter is on by
18           default. Note that even when enabled, this information is only
19           visible to superusers, roles with privileges of the
20           pg_read_all_stats role and the user owning the sessions being
21           reported on (including sessions belonging to a role they have
22           the privileges of), so it should not represent a security risk.
23           Only superusers and users with the appropriate SET privilege can
24           change this setting.
25
26    track_activity_query_size (integer) #
27           Specifies the amount of memory reserved to store the text of the
28           currently executing command for each active session, for the
29           pg_stat_activity.query field. If this value is specified without
30           units, it is taken as bytes. The default value is 1024 bytes.
31           This parameter can only be set at server start.
32
33    track_counts (boolean) #
34           Enables collection of statistics on database activity. This
35           parameter is on by default, because the autovacuum daemon needs
36           the collected information. Only superusers and users with the
37           appropriate SET privilege can change this setting.
38
39    track_cost_delay_timing (boolean) #
40           Enables timing of cost-based vacuum delay (see Section 19.10.2).
41           This parameter is off by default, as it will repeatedly query
42           the operating system for the current time, which may cause
43           significant overhead on some platforms. You can use the
44           pg_test_timing tool to measure the overhead of timing on your
45           system. Cost-based vacuum delay timing information is displayed
46           in pg_stat_progress_vacuum, pg_stat_progress_analyze, in the
47           output of VACUUM and ANALYZE when the VERBOSE option is used,
48           and by autovacuum for auto-vacuums and auto-analyzes when
49           log_autovacuum_min_duration is set. Only superusers and users
50           with the appropriate SET privilege can change this setting.
51
52    track_io_timing (boolean) #
53           Enables timing of database I/O waits. This parameter is off by
54           default, as it will repeatedly query the operating system for
55           the current time, which may cause significant overhead on some
56           platforms. You can use the pg_test_timing tool to measure the
57           overhead of timing on your system. I/O timing information is
58           displayed in pg_stat_database, pg_stat_io (if object is not
59           wal), in the output of the pg_stat_get_backend_io() function (if
60           object is not wal), in the output of EXPLAIN when the BUFFERS
61           option is used, in the output of VACUUM when the VERBOSE option
62           is used, by autovacuum for auto-vacuums and auto-analyzes, when
63           log_autovacuum_min_duration is set and by pg_stat_statements.
64           Only superusers and users with the appropriate SET privilege can
65           change this setting.
66
67    track_wal_io_timing (boolean) #
68           Enables timing of WAL I/O waits. This parameter is off by
69           default, as it will repeatedly query the operating system for
70           the current time, which may cause significant overhead on some
71           platforms. You can use the pg_test_timing tool to measure the
72           overhead of timing on your system. I/O timing information is
73           displayed in pg_stat_io for the object wal and in the output of
74           the pg_stat_get_backend_io() function for the object wal. Only
75           superusers and users with the appropriate SET privilege can
76           change this setting.
77
78    track_functions (enum) #
79           Enables tracking of function call counts and time used. Specify
80           pl to track only procedural-language functions, all to also
81           track SQL and C language functions. The default is none, which
82           disables function statistics tracking. Only superusers and users
83           with the appropriate SET privilege can change this setting.
84
85 Note
86
87           SQL-language functions that are simple enough to be “inlined”
88           into the calling query will not be tracked, regardless of this
89           setting.
90
91    stats_fetch_consistency (enum) #
92           Determines the behavior when cumulative statistics are accessed
93           multiple times within a transaction. When set to none, each
94           access re-fetches counters from shared memory. When set to
95           cache, the first access to statistics for an object caches those
96           statistics until the end of the transaction unless
97           pg_stat_clear_snapshot() is called. When set to snapshot, the
98           first statistics access caches all statistics accessible in the
99           current database, until the end of the transaction unless
100           pg_stat_clear_snapshot() is called. Changing this parameter in a
101           transaction discards the statistics snapshot. The default is
102           cache.
103
104 Note
105
106           none is most suitable for monitoring systems. If values are only
107           accessed once, it is the most efficient. cache ensures repeat
108           accesses yield the same values, which is important for queries
109           involving e.g. self-joins. snapshot can be useful when
110           interactively inspecting statistics, but has higher overhead,
111           particularly if many database objects exist.
112
113 19.9.2. Statistics Monitoring #
114
115    compute_query_id (enum) #
116           Enables in-core computation of a query identifier. Query
117           identifiers can be displayed in the pg_stat_activity view, using
118           EXPLAIN, or emitted in the log if configured via the
119           log_line_prefix parameter. The pg_stat_statements extension also
120           requires a query identifier to be computed. Note that an
121           external module can alternatively be used if the in-core query
122           identifier computation method is not acceptable. In this case,
123           in-core computation must be always disabled. Valid values are
124           off (always disabled), on (always enabled), auto, which lets
125           modules such as pg_stat_statements automatically enable it, and
126           regress which has the same effect as auto, except that the query
127           identifier is not shown in the EXPLAIN output in order to
128           facilitate automated regression testing. The default is auto.
129
130 Note
131
132           To ensure that only one query identifier is calculated and
133           displayed, extensions that calculate query identifiers should
134           throw an error if a query identifier has already been computed.
135
136    log_statement_stats (boolean)
137           log_parser_stats (boolean)
138           log_planner_stats (boolean)
139           log_executor_stats (boolean) #
140           For each query, output performance statistics of the respective
141           module to the server log. This is a crude profiling instrument,
142           similar to the Unix getrusage() operating system facility.
143           log_statement_stats reports total statement statistics, while
144           the others report per-module statistics. log_statement_stats
145           cannot be enabled together with any of the per-module options.
146           All of these options are disabled by default. Only superusers
147           and users with the appropriate SET privilege can change these
148           settings.