pg_stat_statements shows too short COMMIT time

From: "MauMau" <maumau307(at)gmail(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_stat_statements shows too short COMMIT time
Date: 2013-12-12 14:12:04
Message-ID: 84342E669CE749A29FC9E80D774EF8FD@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

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?

[Problem]
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.

[Cause]
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.

[Question]
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?

Regards
MauMau

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2013-12-12 14:32:07 Re: SSL: better default ciphersuite
Previous Message Simon Riggs 2013-12-12 14:05:01 Re: Optimize kernel readahead using buffer access strategy