Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lb5Gk-0001vF-Qr for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Apr 2021 17:43:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lb5Gi-00059e-9Y for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Apr 2021 17:43:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lb5Gi-00059W-2E for pgsql-hackers@lists.postgresql.org; Mon, 26 Apr 2021 17:43:36 +0000 Received: from tamriel.snowman.net ([70.109.60.50]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lb5Gg-0008G7-1m for pgsql-hackers@lists.postgresql.org; Mon, 26 Apr 2021 17:43:35 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 78C8C5F799; Mon, 26 Apr 2021 13:43:32 -0400 (EDT) Date: Mon, 26 Apr 2021 13:43:32 -0400 From: Stephen Frost To: Tom Lane Cc: Magnus Hagander , Bruce Momjian , Christoph Berg , Peter Eisentraut , Fujii Masao , PostgreSQL Developers Subject: Re: compute_query_id and pg_stat_statements Message-ID: <20210426174332.GY20766@tamriel.snowman.net> References: <20210424170908.GM7629@momjian.us> <1709439.1619286231@sss.pgh.pa.us> <20210426162104.GQ7629@momjian.us> <20210426163135.GU20766@tamriel.snowman.net> <2267128.1619456173@sss.pgh.pa.us> <20210426172354.GV20766@tamriel.snowman.net> <2268611.1619458140@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uz98qLkXqquHDvSM" Content-Disposition: inline In-Reply-To: <2268611.1619458140@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --uz98qLkXqquHDvSM Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > * Magnus Hagander (magnus@hagander.net) wrote: > >> That=E4s why I suggested the three value one. Default to a mode where > >> it's automatic, which is what the majority is going to want, but have > >> a way to explicitly turn it on. >=20 > > This is certainly fine with me too, though it seems a bit surprising to > > me that we couldn't just figure out what the user actually wants based > > on what's installed/running for any given combination. >=20 > I'd be on board with having pg_stat_statement's pg_init function do > something to adjust the setting, if we can figure out how to do that > in a way that's not confusing in itself. I'm not sure though that > the GUC engine offers a good way. Both of the extensions are getting loaded via pg_stat_statements and both can have pg_init functions which work together to come up with the right answer, no? That is- can't pg_stat_statements, when it's loaded, enable compute_query_id if it's not already enabled, and then the pg_queryid module simply disable it when it gets loaded in it's pg_init()? Telling people who are using pg_queryid to have it loaded *after* pg_stat_statements certainly seems reasonable to me, but if folks don't like that then maybe have a tri-state which is 'auto', 'on', and 'off', where pg_stat_statements would set it to 'on' if it's set to 'auto', but not do anything if it starts as 'off'. pg_queryid would then set it to 'off' when it's loaded and it wouldn't matter if it's loaded before or after. Thanks, Stephen --uz98qLkXqquHDvSM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJghvvEAAoJEO1sijiDR2RVsYIP/iY5OLvbdWKJrABPJWQZJUlY 2gRzJ3oh69hsYspu2PIJHyqe0zLRTRJZyCKkX0Faq6vkyRTl/+L66r1wNLOcb+ZV 9BT59R2iGbHD2BAfhb2pDTSWBr0SHcGYrS4DCZNuIjM8SQyG6UxrKmQsqnR91qiU ycXnWE+c3mHUksXe+ouN1/XE/j3NzdGTUhCCjrcqBeFSCwx0LUDqCLxWYMREaYqD DZlAFK4tL5S2qWOeZFVutLR1Jg0u+c1ouLTl1Rab+EYo2yAkKAdavlvz8Lb7ZQPN 2nU5M8HG9pYPVQAZkCqQPR4CSz0C/8MyUGbC4knMGoKjWZCBCMGP0fDTbloUxrqQ k2ALstUytE+GEPAMHDRoDgudeMQd7Mh6HZqkV0e20NUAHXcUP0Q3eP3ldUVTjXjd eLQTo/9vur2da/lbi9m7WheyBYmYGM5F89ATTKaQGallGvcNe4sL3sFO8w8LkD4k CrqoDjf1H4IvOOXu6ipWitFc1BN8rOMugIqfpsdD1jvLxelCgzAiKiuRjJc/85DD VRTwCsNHSoXEk9GAcdcjZEUZ4+JNkFNWHQcT1/7nbgt5eXfS2PlfG0i81Hthvc+a OTYXcvaumgz+R2zRJlAMabjIW+UU3QtL2QTf8JtcdJV8HJAe2Cm9ZeSfdKxprReq 8o+vAG9YQZrMTQFsKz5j =0Z4r -----END PGP SIGNATURE----- --uz98qLkXqquHDvSM--