Thread: Postgres log statistics

Postgres log statistics

From
Christian Bucanac
Date:
Hi!

In Postgres you can log a lot of stuff and statistics by modifying some of
the following flags:
debug_print_query
show_parser_stats
show_planner_stats
show_executor_stats
show_query_stats

What I wonder is, if there are any tools, perl scripts or similar, to
analyze / data mine the output in the postmaster log that these flags
produce?

I am interested in knowing for example how often every SQL statement is
executed how long time it took to execute it. It would also be good to have
the output presented with the most frequently executed statements and the
longest execution time at the "top" of the report. This way you could fast
and easy identify where to focus your improvement effort.

I have been looking at "PostgreSQL Log Analyzer v1.1". It is not good enough
because it does not do enough analyzing. In some cases, it considers two
same SQL statements different because they use different data and it does
not sort the SQL statements by frequency.

Thanks for your help!

/Buckis