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

From Andrew Dunstan
Subject Re: Add min and max execute statement time in pg_stat_statement
Date
Msg-id 549719B5.6070605@dunslane.net
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
List pgsql-hackers
On 12/21/2014 01:23 PM, Alvaro Herrera wrote:
> Andrew Dunstan wrote:
>
>> On my blog Peter Geoghegan mentioned something about "atomic fetch-and-add"
>> being useful here, but I'm not quite sure what that's referring to. Perhaps
>> someone can give me a pointer.
> The point, I think, is that without atomic instructions you have to hold
> a lock while incrementing the counters.
>

Hmm, do we do that now? That won't work for the stddev method I was 
referring to, although it could for the sum of squares method. In that 
case I would like someone more versed in numerical analysis than me to 
tell me how safe using sum of squares actually is in our case. And how 
about min and max? They don't look like good candidates for atomic 
operations.

cheers

andrew



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Add min and max execute statement time in pg_stat_statement
Next
From: Tom Lane
Date:
Subject: Re: Add min and max execute statement time in pg_stat_statement