- publishing free software manuals
PostgreSQL Reference Manual - Volume 3 - Server Administration Guide
by The PostgreSQL Global Development Group
Paperback (6"x9"), 204 pages
ISBN 0954612043
RRP £13.95 ($24.95)

Sales of this book support the PostgreSQL project! Get a printed copy>>>

12.2.1 Statistics Collection Configuration

Since collection of statistics adds some overhead to query execution, the system can be configured to collect or not collect information. This is controlled by configuration parameters that are normally set in ‘postgresql.conf’. (See section 4 Server Configuration for details about setting configuration parameters.)

The parameter stats_start_collector must be set to true for the statistics collector to be launched at all. This is the default and recommended setting, but it may be turned off if you have no interest in statistics and want to squeeze out every last drop of overhead. (The savings is likely to be small, however.) Note that this option cannot be changed while the server is running.

The parameters stats_block_level and stats_row_level control how much information is actually sent to the collector and thus determine how much run-time overhead occurs. These respectively determine whether a server process tracks disk-block-level access statistics and row-level access statistics and sends these to the collector. Additionally, per-database transaction commit and abort statistics are collected if either of these parameters are set.

The parameter stats_command_string enables monitoring of the current command being executed by any server process. The statistics collector subprocess need not be running to enable this feature.

Normally these parameters are set in ‘postgresql.conf’ so that they apply to all server processes, but it is possible to turn them on or off in individual sessions using the SET command. (To prevent ordinary users from hiding their activity from the administrator, only superusers are allowed to change these parameters with SET.)

Note: Since the parameters stats_block_level, and stats_row_level default to false, very few statistics are collected in the default configuration. Enabling either of these configuration variables will significantly increase the amount of useful data produced by the statistics facilities, at the expense of additional run-time overhead.

ISBN 0954612043PostgreSQL Reference Manual - Volume 3 - Server Administration GuideSee the print edition