I've found a problem with pg_stat_statements while doing some performance test. If the fix is desired and not difficult, I'm willing to address it. Could you give me any information and/or your opinions?

The time of COMMIT statements is unreasonably short. pg_stat_statements' result shows that the average COMMIT time is 2 us (calls=200, total_time=0.4 ms). It doesn't include most of the commit processing, including WAL flush.

pg_stat_statements measures the time taken in ProcessUtility(). However, ProcessUtility() only updates some transaction state variables. The actual COMMIT processing, CommitTransactionCommand(), is called from finish_xact_command() in postgres.c. This is not measured.

Is this an expected behavior to be kept as now?
If no, can this be fixed easily (and how)? Is the actual commit processing out of the scope of pg_stat_statements?


Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to