Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

From: Maksim Milyutin <milyutinma(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Yun Li <liyunjuanyong(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Date: 2019-03-19 13:45:17
Message-ID: e26f1ee3-ff22-f871-2348-b04dbc98ec3e@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/16/19 5:32 PM, Robert Haas wrote:

> There's only one query ID field available, and
> you can't use two extensions that care about query ID unless they
> compute it the same way, and replicating all the code that computes
> the query ID into each new extension that wants one sucks. I think we
> should actually bite the bullet and move all of that code into core,
> and then just let extensions say whether they care about it getting
> set.

+1.

But I think that enough to integrate into core the query normalization
routine and store generalized query strings (from which the queryId is
produced) in shared memory (for example, hashtable that maps queryId to
the text representation of generalized query). And activate
normalization routine and filling the table of generalized queries by
specified GUC.

This allows to unbind extensions that require queryId from using
pg_stat_statements and consider such computing of queryId as canonical.

--
Regards,
Maksim Milyutin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2019-03-19 14:09:17 Re: [HACKERS] [PATCH] Generic type subscripting
Previous Message Alvaro Herrera 2019-03-19 13:37:00 Re: partitioned tables referenced by FKs