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 1m7mtr-0005CQ-7n for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Jul 2021 22:47:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m7mtp-0006OY-Qt for pgsql-hackers@arkaria.postgresql.org; Sun, 25 Jul 2021 22:47:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m7mtp-0006OQ-JO for pgsql-hackers@lists.postgresql.org; Sun, 25 Jul 2021 22:47:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m7mtj-0002XR-Eb for pgsql-hackers@postgresql.org; Sun, 25 Jul 2021 22:47:08 +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 16PMkrV5006767; Sun, 25 Jul 2021 18:46:53 -0400 From: Tom Lane To: Andrew Dunstan cc: Fujii Masao , Julien Rouhaud , Sergei Kornilov , "imai.yoshikazu@fujitsu.com" , legrand legrand , "pgsql-hackers@postgresql.org" Subject: Re: Planning counters in pg_stat_statements (using pgss_store) In-reply-to: <84f3a8f0-2041-d4a4-4f46-ec1f99b90fb1@dunslane.net> References: <20200329061549.smtokn3ip5pqldia@nol> <8224bfdf-dcf8-648f-e0d8-1db1d5c215ee@oss.nttdata.com> <20200330080359.GD79261@nol> <1c348d6a-02e5-ef14-b9e7-22f7f36fcee1@oss.nttdata.com> <8c6449d4-5fd7-f544-182b-a4bb7da1d18c@oss.nttdata.com> <20200331060307.e7kypfynz7jous62@nol> <20200331073321.bhnx2p63gp5px37f@nol> <20200331184217.tf3x534uz4vusgmp@nol> <13923268-bad9-80f9-2542-5fd5e8b8c500@oss.nttdata.com> <42557.1627229005@sss.pgh.pa.us> <84f3a8f0-2041-d4a4-4f46-ec1f99b90fb1@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Sun, 25 Jul 2021 18:25:42 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6765.1627253213.1@sss.pgh.pa.us> Date: Sun, 25 Jul 2021 18:46:53 -0400 Message-ID: <6766.1627253213@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrew Dunstan writes: > On 7/25/21 12:03 PM, Tom Lane wrote: >> So AFAICS this test is inherently unstable and there is no code bug >> to be fixed. We could drop the "plans" column from this query, or >> print something approximate like "plans > 0 AND plans <= calls". >> Thoughts? > Is that likely to tell us anything very useful? The variant suggested downthread ("plans >= 2 AND plans <= calls" for the PREPARE entry only) seems like it's still reasonably useful. At least it can verify that a replan has occurred and been counted. regards, tom lane