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

From Andres Freund
Subject Re: Add min and max execute statement time in pg_stat_statement
Date
Msg-id 4EEECFF9-3BCD-49E3-82DC-51DA8DCD7C44@anarazel.de
Whole thread Raw
In response to Re: Add min and max execute statement time in pg_stat_statement  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On December 21, 2014 7:23:27 PM CET, Alvaro Herrera <alvherre@2ndquadrant.com> 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.

Port/atomics.h provides a abstraction for doing such atomic manipulations.

Andres

--- 
Please excuse brevity and formatting - I am writing this on my mobile phone.



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Add min and max execute statement time in pg_stat_statement
Next
From: Andrew Dunstan
Date:
Subject: Re: Add min and max execute statement time in pg_stat_statement