Re: Add min and max execute statement time in pg_stat_statement - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Add min and max execute statement time in pg_stat_statement
Date
Msg-id CAM3SWZSq1S2WjRP8h2SxuJh+_2-Toa+uFAApUK3e67kobMpsrg@mail.gmail.com
Whole thread Raw
In response to Re: Add min and max execute statement time in pg_stat_statement  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Add min and max execute statement time in pg_stat_statement  (Fujii Masao <masao.fujii@gmail.com>)
Re: Add min and max execute statement time in pg_stat_statement  (KONDO Mitsumasa <kondo.mitsumasa@lab.ntt.co.jp>)
List pgsql-hackers
On Wed, Oct 23, 2013 at 8:52 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Hmm, now if we had portable atomic addition, so that we could spare the
> spinlock ...

That certainly seems like an interesting possibility.

I think that pg_stat_statements should be made to do this kind of
thing by a third party tool that aggregates snapshots of deltas.
Time-series data, including (approximate) *local* minima and maxima
should be built from that. I think tools like KONDO-san's pg_statsinfo
tool have an important role to play here. I would like to see it or a
similar tool become a kind of defacto standard for consuming
pg_stat_statements' output.

At this point we are in general very much chasing diminishing returns
by adding new things to the counters struct, particularly given that
it's currently protected by a spinlock. And adding a histogram or
min/max for something like execution time isn't an approach that can
be made to work for every existing cost tracked by pg_stat_statements.
So, taking all that into consideration, I'm afraid this patch gets a
-1 from me.


-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: logical changeset generation v6.5
Next
From: Josh Berkus
Date:
Subject: Re: additional json functionality