log_planner_stats

A configuration parameter determining whether to log planner statistics for a statement

log_planner_stats is a configuration parameter determining whether to log detailed planner statistics for a statement.

log_planner_stats was added in PostgreSQL 7.4.

Usage

If log_planner_stats is set to "on", a DETAIL line will be emitted containing details about the statement planning, including execution time and memory / i/o usage.

log_planner_stats cannot be enabled at the same time as log_statement_stats.

Default value

The default value for log_planner_stats is: off.

Change history

Examples

Log output from issuing a simple statement ("SELECT 1"):

[2021-03-29 22:55:15 UTC] psql postgres postgres STATEMENT:  SELECT 1;
[2021-03-29 22:55:15 UTC] psql postgres postgres LOG:  00000: PLANNER STATISTICS
[2021-03-29 22:55:15 UTC] psql postgres postgres DETAIL:  ! system usage stats:
        !       0.000011 s user, 0.000035 s system, 0.000047 s elapsed
        !       [0.000683 s user, 0.002041 s system total]
        !       14380 kB max resident size
        !       0/0 [0/0] filesystem blocks in/out
        !       0/1 [0/495] page faults/reclaims, 0 [0] swaps
        !       0 [0] signals rcvd, 0/0 [0/0] messages rcvd/sent
        !       0/0 [5/0] voluntary/involuntary context switches

Categories

GUC configuration item, Logging

See also

log_executor_stats, log_parser_stats, log_statement_stats