HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

How to get the information of the optimizer of PostgreSQL?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlthehowgetoptimizerinformation

Problem

I am curious about the information like

  • total optimization time



  • the time spent on each stage of optimization



  • the number of alternative plans and



  • the cost of each alternative plan.

Solution

You can get some of that information by turning on the configuration parameter log_planner_stats. Most of that information, however, doesn't really exist, because the planner does not fully compute all alternative plans and their costs. It only explores an alternative plan until it can determine that it is slower than the current best plan. So alternative plans are not fully materialized.

Context

StackExchange Database Administrators Q#42355, answer score: 4

Revisions (0)

No revisions yet.