Re: pg_stat_statments queryid

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_statments queryid
Date: 2012-05-24 14:55:43
Message-ID: CA+TgmobYvnyeQvQ6wJg_pwhuSUvf7h94ANNuojtkLLpcUYkihg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 24, 2012 at 10:26 AM, Peter Geoghegan <peter(at)2ndquadrant(dot)com> wrote:
> On 24 May 2012 11:50, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
>> Was there any actual reason why we didn't end up exposing queryid in
>> the pg_stat_statements view?
>>
>> It would be highly useful when tracking changes over time. Right now I
>> see people doing md5(query) to do that, which is a lot more ugly (and
>> obviously uses more space and is slow, too).
>
> Right. I continue to maintain that this is a good idea. I raised the
> issue more than once. However, my proposal was not accepted by Tom and
> Robert, apparently on the basis that queryId's actual value was
> partially dictated by things like the endianness of the architecture
> used, and the value of OIDs when serialising and subsequently hashing
> the post-analysis tree.

No, my concern was more that I wasn't clear on what you hoped to do with it.

But I think this explanation is enough to convince me that it might be
worthwhile:

> What I'd like to be able to do is aggregate this information over time
> and/or across standbys in a cluster, as queries are evicted and
> subsequently re-entered into pg_stat_statement's shared hash table.
> Now, there are situations were this isn't going to work, like when a
> third-party logical replication system is used. That's unfortunate,
> but I wouldn't expect it makes the information any less useful to the
> large majority of people. I'd also credit our users with being
> discerning enough to realise that they should not jump to the
> conclusion that the value will be stable according to any particular
> standard.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2012-05-24 15:04:43 Re: [RFC] Interface of Row Level Security
Previous Message Magnus Hagander 2012-05-24 14:44:00 Re: pg_stat_statments queryid