Archive

Posts Tagged ‘database’

pgFouine PostgreSQL log analyzer

February 11th, 2009 No comments

If you have a busy PostgreSQL database you may want to know which query takes up most of the time of the postmaster. To create a nice overview of slowest and most frequent queries you can use pgFouine.
This PHP script can parse a PostgreSQL log and create different reports.

The command I usually use:

./pgfouine.php -from "- 1 week" -memorylimit 512 -file <logfile.log>
-logtype stderr -title 'PostgreSQL analyze' -report db-report.html=
overall,bytype,hourly,slowest,n-mosttime,n-mostfrequent,n-slowestaverage,
n-mostfrequenterrors -format html-with-graphs