Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: DBI and keeping track of planner statisticsby erix (Prior) |
on Jan 03, 2017 at 21:45 UTC ( [id://1178882]=note: print w/replies, xml ) | Need Help?? |
In the main postgres configuration file, postgresql.conf, you could set log_min_duration_statement to some value larger than zero. The value is expressed in milliseconds, so for instance setting it to 1000 makes the server log all SQL statements that take longer than 1 second. It may or may not fit your case. (You'd also need some process monitoring that log, I guess.) The default setting of this parameter is -1 (=disabled):
And, by the way, you don't need to run "EXPLAIN" queries manually. EXPLAIN has nice machine-readable output formats like json and yaml. For example:
The output:
In Section
Seekers of Perl Wisdom
|
|