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

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Julien Rouhaud <rjuju123(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nitin Jadhav <nitinjadhavpostgres(at)gmail(dot)com>, Hannu Krosing <hannuk(at)google(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>, Atsushi Torikoshi <atorik(at)gmail(dot)com>, Tatsuro Yamada <tatsuro(dot)yamada(dot)tf(at)nttcom(dot)co(dot)jp>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Evgeny Efimkin <efimkin(at)yandex-team(dot)ru>, 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: 2021-04-21 15:28:11
Message-ID: a878d5ea-64a7-485e-5d2f-177618ebc52d@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021/04/21 1:22, Bruce Momjian wrote:
> On Wed, Apr 14, 2021 at 02:33:26PM -0400, Bruce Momjian wrote:
>> On Tue, Apr 13, 2021 at 01:30:16PM -0400, Álvaro Herrera wrote:
>>> On 2021-Apr-12, Bruce Momjian wrote:
>>>
>>>> OK, the attached patch renames pg_stat_activity.queryid to 'query_id'. I
>>>> have not changed any of the APIs which existed before this feature was
>>>> added, and are called "queryid" or "queryId" --- it is kind of a mess.
>>>> I assume I should leave those unchanged. It will also need a catversion
>>>> bump.
>>>
>>> I think it is fine actually. These names appear in structs Query and
>>> PlannedStmt, and every single member of those already uses camelCase
>>> naming. Changing those to use "query_id" would look out of place.
>>> You did change the one in PgBackendStatus to st_query_id, which also
>>> matches the naming style in that struct, so that looks fine also.
>>>
>>> So I'm -1 on Julien's first proposed change, and +1 on his second
>>> proposed change (the name of the first argument of
>>> pgstat_report_query_id should be query_id).
>>
>> Thanks for your analysis. Updated patch attached with the change
>> suggested above.
>
> Patch applied.

I found another small issue in pg_stat_statements docs. The following
description in the docs should be updated so that toplevel is included?

> This view contains one row for each distinct database ID, user ID and query ID

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ian Zagorskikh 2021-04-21 15:35:18 Re: libpq compression
Previous Message Robert Haas 2021-04-21 15:21:31 decoupling table and index vacuum