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 1lb5J0-0001yi-L9 for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Apr 2021 17:45:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lb5Iz-00011M-K7 for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Apr 2021 17:45:57 +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 1lb5Iz-00011F-DK for pgsql-hackers@lists.postgresql.org; Mon, 26 Apr 2021 17:45:57 +0000 Received: from tamriel.snowman.net ([70.109.60.50]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lb5It-0008IC-8E for pgsql-hackers@lists.postgresql.org; Mon, 26 Apr 2021 17:45:56 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id C9F235F799; Mon, 26 Apr 2021 13:45:49 -0400 (EDT) Date: Mon, 26 Apr 2021 13:45:49 -0400 From: Stephen Frost To: Alvaro Herrera Cc: Tom Lane , Magnus Hagander , Bruce Momjian , Christoph Berg , Peter Eisentraut , Fujii Masao , PostgreSQL Developers Subject: Re: compute_query_id and pg_stat_statements Message-ID: <20210426174549.GZ20766@tamriel.snowman.net> References: <2268611.1619458140@sss.pgh.pa.us> <20210426174331.GA19401@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ExSZ/8Wn45kmqr+O" Content-Disposition: inline In-Reply-To: <20210426174331.GA19401@alvherre.pgsql> 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 --ExSZ/8Wn45kmqr+O Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Alvaro Herrera (alvherre@alvh.no-ip.org) wrote: > On 2021-Apr-26, Tom Lane wrote: >=20 > > 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. >=20 > I think it's straightforward, if we decouple the tri-valued enum used > for guc.c purposes from a separate boolean that actually enables the > feature. GUC sets the boolean to "off" initially when it sees the enum > as "auto", and then pg_stat_statement's _PG_init modifies it during its > own startup as needed. >=20 > So the user can turn the GUC off, and then pg_stat_statement does > nothing and there is no performance drawback; or leave it "auto" and > it'll only compute query_id if pg_stat_statement is loaded; or leave it > on if they want the query_id for other purposes. Yeah, this is more-or-less the same as what I was just proposing in an email that crossed this one. Using a separate boolean would certainly be fine. Thanks, Stephen --ExSZ/8Wn45kmqr+O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJghvxNAAoJEO1sijiDR2RVDesQAJXevN2kiBJAgf50S2nk1vzU cVENQCBaqajNXSO+CaobsDgyV2odlaUfJbsMgg5w9/J3JuGri+dpVPoKWuEoEEj3 NDXbMZp5Dg7tI72hRwQ9tm63kbfv18BGjMLEZPRnw6J6RazOCwjFh/BLHUs+FP+s TL0fOjUFVuybQkxoferj5QSVo/OtBFgO+DjqHfuO0HPUWjVRmUtb5/Lr6Sw34Bnq V+gWHw5UEAZ/ks6gyjjJLXQYyZMxa2QqhgMPmG4ZwsZhbcqw+cE5WtJqoOxdvAkg jnJIBZgzeVZnsCNRHYv2yCSXaAF9kqNaH+9HsciLQcDmDXFzSBtK7rT/mcDnl7cN eRFs+bTlD7OQaop0J40lw8Ygf64nXjYVtz7tEaNd2rpYNoY4Yu2ha/m1inM0Fpp2 mCMJituGMsMqu2sdzwPoktuV0V7MvsNxQWCjVG6ay0J8Sp3xDLEKNaJbn8O6pVnr 9hqm2j5z5OrZ6+XqxzDYqFrPTsxFssuF+hHjZ+qXPV8QWRphEoAMcs9XtW8uhMgT 2EmGsw3atdHakRwc8Veku8fMu96I3aAI95aK2wvklYbnk7rgGJzfssDUly7aS6GY AvbFKTclRtb2KIBbjTuRZsQ4BO4I1Mg9IEJN/c7AlHifsz8AIYLoV44NdaZFiFM+ rhnabSm75bu31bivNOsF =NO8q -----END PGP SIGNATURE----- --ExSZ/8Wn45kmqr+O--