I configured my postgresql.conf (my version is 9.1) with the normal persistent configuration:
shared_preload_libraries = 'pg_stat_statements,plperl'
custom_variable_classes = 'pg_stat_statements,plperl'
pg_stat_statements.max = 100
pg_stat_statements.track = all
pg_stat_statements.save = on
I let one month to run within a database which is constantly accessed with read/write queries.
After a month (or generally enough time to be sure lots of queries were executed) I do the documentation query with top five slowest queries, and get this result:
-[ RECORD 1 ]---------------------------------------------------------------
query | UPDATE XXXXXXXX
calls | 63486
total_time | 238.271792999997
rows | 40740
hit_percent | 99.9938060778852878
-[ RECORD 2 ]---------------------------------------------------------------
query | SELECT XXXXXXXX
calls | 67347
total_time | 0.852444000000713
rows | 67347
hit_percent | 100.0000000000000
... and so on. I see the real number of calls as total_time is (very) much bigger for this queries than this view says. I don't understand how this works, because I expected hours in the total_time field as my server is running for more than 3 months without restarting.
In general is a no-change-from-doc configuration, and I get nonsense results.