From: Julien Rouhaud <rjuju123@gmail.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Hannu Krosing <hannuk@google.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: torikoshia <torikoshia@oss.nttdata.com>
Cc: Atsushi Torikoshi <atorik@gmail.com>
Cc: Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Evgeny Efimkin <efimkin@yandex-team.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Date: Thu, 8 Apr 2021 12:17:58 +0800
Message-ID: <20210408041758.amzavdu5rmvv6low@nol> (raw)
In-Reply-To: <20210407181211.GB24239@momjian.us>
References: <20210401182802.d7o632hxdgwita32@nol>
<20210401192711.GD18031@momjian.us>
<20210402053328.adqgua4fbjyx6ber@nol>
<20210404141850.6nalgsl7otbt3hri@nol>
<20210405171627.GA12179@momjian.us>
<CAMm1aWZBBPPjRau9dP6+PZFoirKMvy3tX5uqrY-wF0PgR9KvSg@mail.gmail.com>
<20210406151102.b2ytqji4m6wfhraf@nol>
<CAMm1aWbTTc7AJrAZa7q1QgNNqdNkFP_-owKHDR=zEjQGqevnpg@mail.gmail.com>
<20210407125726.tkvjdbw76hxnpwfi@nol>
<20210407181211.GB24239@momjian.us>
On Wed, Apr 07, 2021 at 02:12:11PM -0400, Bruce Momjian wrote:
>
> Patch applied. I am ready to adjust this with any improvements people
> might have. Thank you for all the good feedback we got on this, and I
> know many users have waited a long time for this feature.
Thanks a lot Bruce and everyone! I hope that the users who waited a long time
for this will find everything they need.
Just to validate that this patchset also allows user to use pg_stat_statements,
any additional third-party module and the new added infrastructure with the
queryid algorithm of their choice, I created a POC extension ([1]) which works
as expected.
Basically:
SHOW shared_preload_libraries;
shared_preload_libraries
--------------------------
pg_stat_statements, pg_queryid
(1 row)
SET pg_queryid.use_object_names TO on;
SET pg_queryid.ignore_schema TO on;
CREATE SCHEMA ns1; CREATE TABLE ns1.tbl1(id integer);
CREATE SCHEMA ns2; CREATE TABLE ns2.tbl1(id integer);
SET search_path TO ns1;
SELECT COUNT(*) FROM tbl1;
SET search_path TO ns2;
SELECT COUNT(*) FROM tbl1;
SELECT queryid, query, calls
FROM public.pg_stat_statements
WHERE query LIKE '%tbl%';
queryid | query | calls
---------------------+---------------------------+-------
4629593225724429059 | SELECT count(*) from tbl1 | 2
(1 row)
So whether that's a good idea to do that or not, users now have a choice.
[1]: https://github.com/rjuju/pg_queryid
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: rjuju123@gmail.com, bruce@momjian.us, nitinjadhavpostgres@gmail.com, alvherre@alvh.no-ip.org, hannuk@google.com, robertmhaas@gmail.com, pavel.stehule@gmail.com, tgl@sss.pgh.pa.us, michael@paquier.xyz, torikoshia@oss.nttdata.com, atorik@gmail.com, tatsuro.yamada.tf@nttcom.co.jp, tomas.vondra@2ndquadrant.com, efimkin@yandex-team.ru, pgsql-hackers@lists.postgresql.org
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
In-Reply-To: <20210408041758.amzavdu5rmvv6low@nol>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox