Parameter · Statistics / Monitoring
log_planner_stats
Writes planner performance statistics to the server log.
- Default:
off - Type: bool
- Applies: Session (superuser)
In plain words
Writes a resource-usage block to the log after the planner has chosen a plan for each statement. Handy when you suspect planning, not execution, is what is slow.
For DBAs and operators
Captured on 18.6: LOG: PLANNER STATISTICS followed by the ! system usage stats block (see log_statement_stats). Mutually exclusive with log_statement_stats.
Planning time is easier to read from EXPLAIN (ANALYZE) (Planning Time: …, and Planning: Buffers … for catalog reads) or pg_stat_statements.total_plan_time (with pg_stat_statements.track_planning = on). Use this when you need the OS view: memory growth (max resident size) or page faults during planning of very large joins or partitioned tables with thousands of partitions.
How to change it
A superuser (or a role granted SET) can change it per session with SET.
See it in context
Related parameters
log_statement_stats log_parser_stats log_executor_stats join_collapse_limit