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 1lagra-0005Jc-Qw for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Apr 2021 15:40:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lagrZ-000330-Od for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Apr 2021 15:40:01 +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 1lagrZ-00032k-Ic for pgsql-hackers@lists.postgresql.org; Sun, 25 Apr 2021 15:40:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lagrY-0004Gd-3m for pgsql-hackers@lists.postgresql.org; Sun, 25 Apr 2021 15:40:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13PFdtpD1934988; Sun, 25 Apr 2021 11:39:55 -0400 From: Tom Lane To: Julien Rouhaud cc: Bruce Momjian , Magnus Hagander , Fujii Masao , PostgreSQL Developers Subject: Re: compute_query_id and pg_stat_statements In-reply-to: <20210425082251.pokyapaxlzdr7k2t@nol> References: <35457b09-36f8-add3-1d07-6034fa585ca8@oss.nttdata.com> <20210424152220.GL7629@momjian.us> <20210424170908.GM7629@momjian.us> <1709439.1619286231@sss.pgh.pa.us> <20210425082251.pokyapaxlzdr7k2t@nol> Comments: In-reply-to Julien Rouhaud message dated "Sun, 25 Apr 2021 16:22:51 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1934986.1619365195.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 25 Apr 2021 11:39:55 -0400 Message-ID: <1934987.1619365195@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Julien Rouhaud writes: > On Sat, Apr 24, 2021 at 01:43:51PM -0400, Tom Lane wrote: >> I haven't looked, but did we put anything into pg_stat_statements >> to make it easy to tell if you've messed up this setting? > You mean apart from from having pg_stat_statements' view/SRFs returning > nothing? > I think it's a reasonable use case to sometime disable query_id calculat= ion, > eg. if you know that it will only lead to useless bloat in the entry and= that > you won't need the info, so spamming warnings if there are no queryid co= uld > cause some pain. I agree repeated warnings would be bad news. I was wondering if we could arrange a single warning at the time pg_stat_statements is preloaded into the postmaster. In this way, if you tried to use a configuration file that used to work, you'd hopefully get some notice about why it no longer does what you want. Also, if you are preloading pg_stat_statements, it seems reasonable to assume that you'd like the global value of the flag to be "on", even if there are use-cases for transiently disabling it. I think the way to detect "being loaded into the postmaster" is if (IsPostmasterEnvironment && !IsUnderPostmaster) regards, tom lane