June 2024
Intermediate to advanced
456 pages
11h 34m
English
To get plans automatically, we can use the PostgreSQL auto_explain module.
In the same way, you configured a minimum statement duration, which logged query text when queries exceeded that duration, auto_explain can log plans when a statement exceeds a certain duration.
auto_explain does add some overhead. Review the section that describes how “repeatedly reading the system clock can slow down queries” in the documentation.[178]
Once you’ve determined the overhead is acceptable, start with a high value for your system, like one second, as the value for auto_explain.log_min_duration. This means that queries that take more than one second will have their execution plans logged to the postgresql.log.
When ...
Read now
Unlock full access