pg_stat_statements shows too short COMMIT time - Mailing list pgsql-hackers

From MauMau
Subject pg_stat_statements shows too short COMMIT time
Date
Msg-id 84342E669CE749A29FC9E80D774EF8FD@maumau
Whole thread Raw
List 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





pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Optimize kernel readahead using buffer access strategy
Next
From: Marko Kreen
Date:
Subject: Re: SSL: better default ciphersuite