The query and index statistics collector is used to collect statistics during database running. The statistics include the times of inserting and updating a table and an index, the number of disk blocks and tuples, and the time required for the last cleanup and analysis on each table. The statistics can be viewed by querying system view families pg_stats and pg_statistic. The following parameters are used to set the statistics collection feature in the server scope.
Parameter description: Collects statistics about the commands that are being executed in session.
Type: SUSET
Value range: Boolean
Default value: on
Parameter description: Collects statistics about data activities.
Type: SUSET
Value range: Boolean
When the database to be cleaned up is selected from the AutoVacuum automatic cleanup process, the database statistics are required. In this case, the default value is set to on.
Default value: on
Parameter description: Collects statistics about I/O invoking timing in the database. The I/O timing statistics can be queried by using the pg_stat_database parameter.
Type: SUSET
Value range: Boolean
Default value: off
Parameter description: Collects statistics about invoking times and duration in a function.
Type: SUSET
When the SQL functions are set to inline functions queried by the invoking, these SQL functions cannot be traced no matter these functions are set or not.
Value range: enumerated values
Default value: none
Parameter description: Collects statistics updated with a process name each time the server receives a new SQL statement.
The process name can be viewed on Windows task manager by running the ps command.
Type: SUSET
Value range: Boolean
Default value: off
Parameter description: Specifies the interval of collecting the thread status information periodically.
Type: SUSET
Value range: an integer ranging from 0 to 1440, in minutes.
Default value: 30min
Parameter description: Specifies whether to record the time when INSERT, UPDATE, DELETE, or EXCHANGE/TRUNCATE/DROP PARTITION is performed on table data.
Type: USERSET
Value range: Boolean
Default value: on
Parameter description: Specifies whether to record the last access time of a table. This parameter is supported only by 8.2.1.210 and later cluster versions.
Type: USERSET
Value range: Boolean
Default value: off
Parameter description: Specifies whether to collect Unique SQL statements and the maximum number allowed.
Type: SIGHUP
Value range: an integer ranging from 0 to INT_MAX
Default value: 0
If a new value is smaller than the original value, the Unique SQL statistics collected on the CN will be cleared.
Parameter description: Specifies whether to collect statistics on the number of the SELECT, INSERT, UPDATE, DELETE, and MERGE INTO statements that are being executed in each session, the response time of the SELECT, INSERT, UPDATE, and DELETE statements, and the number of DDL, DML, and DCL statements.
Type: SUSET
Value range: Boolean
Default value: on
Parameter description: Specifies whether to use parallel sampling for internal and foreign table analysis. This parameter is supported only by clusters of version 9.1.0 or later.
Type: USERSET
Value range: Boolean
Default value: true
Parameter description: Specifies the number of concurrent threads for parallel analyze sampling. This parameter is supported only by clusters of version 9.1.0 or later.
Type: USERSET
Value range: an integer ranging from 0 to 64
Default value: 10
The value of this parameter should correspond to the cluster load. When the cluster load is low, you can increase the parameter value appropriately based on the cluster configuration to further improve the efficiency of analyze execution.
Parameter description: Specifies the multiplier for the stripe sampling rate used in analyzing foreign tables. This parameter is supported only by clusters of version 9.1.0 or later.
Type: SUSET
Value range: an integer ranging from 0 to 100. 0 indicates that the stripe sampling rate is 100%.
Default value: 3