Here is an updated version of pg_stat_statements. [Changes] - A new GUC variable 'explain_analyze_format' is added. - Statistics counters are converted into a variable 'BufferStats'.
"Vladimir Sitnikov" <sitnikov.vladi...@gmail.com> wrote: > Can I ask my question once again? > Why don't you want to make "print all the info" the default output format? I added a new GUC variable 'explain_analyze_format' to print all statistics counters in EXPLAIN ANALYZE. We can set special variables into it to get non-default counters. I think everyone don't always require all the info. Of course TABLE-explain and XML-explain could handle the counters better, but this patch should not include them. A variable 'BufferStats' is for cleanup calculations of many separated counters. It is exported (marked as PGDLLIMPORT) so that users can add a user-defined view like pg_stat_session_buffer_usage if needed. Comments welcome. [Sample output of explain_analyze_format] =# SET explain_analyze_format = ' gets=%g reads=%r temp=%t cpu=%p'; =# EXPLAIN ANALYZE SELECT * FROM accounts; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- Seq Scan on accounts (cost=0.00..2640.00 rows=100000 width=97) (actual time=0.054..117.046 rows=100000 loops=1 gets=1640 reads=1608 temp=0 cpu=125.00) Total runtime: 208.167 ms (2 rows) The following special variables are available: %g : # of shared buffer gets (= %h + %r) %h : # of shared buffer hits %r : # of shared buffer reads %w : # of shared buffer writes %G : # of local buffer gets (= %H + %R) %H : # of local buffer hits %R : # of local buffer reads %W : # of local buffer writes %t : # of buffile reads %T : # of buffile writes %u : user cpu time %s : sys cpu time %p : total cpu times (= %u + %s) Regards, --- ITAGAKI Takahiro NTT Open Source Software Center
pg_stat_statements-1212.tar.gz
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers