Re: Add min and max execute statement time in pg_stat_statement

From: Andres Freund <andres(at)anarazel(dot)de>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, KONDO Mitsumasa <kondo(dot)mitsumasa(at)lab(dot)ntt(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, Mitsumasa KONDO <kondo(dot)mitsumasa(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: Add min and max execute statement time in pg_stat_statement
Date: 2014-12-21 18:25:43
Message-ID: 4EEECFF9-3BCD-49E3-82DC-51DA8DCD7C44@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On December 21, 2014 7:23:27 PM CET, Alvaro Herrera <alvherre(at)2ndquadrant(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2014-12-21 19:04:21 Re: Add min and max execute statement time in pg_stat_statement
Previous Message Alvaro Herrera 2014-12-21 18:23:27 Re: Add min and max execute statement time in pg_stat_statement