Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ufLdg-0061iC-BD for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Jul 2025 16:51:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ufLdf-002kPu-4K for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Jul 2025 16:51:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ufLde-002kPm-QX for pgsql-hackers@lists.postgresql.org; Fri, 25 Jul 2025 16:51:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ufLdd-000kXJ-0u for pgsql-hackers@postgresql.org; Fri, 25 Jul 2025 16:51:18 +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 56PGpCrE1933907; Fri, 25 Jul 2025 12:51:12 -0400 From: Tom Lane To: Sami Imseih cc: Michael Paquier , Andrei Lepikhov , Greg Sabino Mullane , pgsql-hackers , Nikolay Samokhvalov , Ilia Evdokimov Subject: Re: track generic and custom plans in pg_stat_statements In-reply-to: References: <1647760.1753369510@sss.pgh.pa.us> <1673684.1753379027@sss.pgh.pa.us> Comments: In-reply-to Sami Imseih message dated "Fri, 25 Jul 2025 10:29:01 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1933905.1753462272.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 25 Jul 2025 12:51:12 -0400 Message-ID: <1933906.1753462272@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Sami Imseih writes: >> Perhaps CachedPlanType is >> misnamed, though, would it be more suited to name that as a sort of >> "origin" or "source" field concept? We want to know which which >> source we have retrieved a plan that a PlannedStmt refers to. > Hmm, I’m not sure I see this as an improvement. In my opinion, > CachedPlanType is a clear name that describes its purpose. I think Michael's got a point. As of HEAD there are seven different places that are setting this to PLAN_CACHE_NONE; who's to say that pg_stat_statements or some other extension might not wish to distinguish some of those sources? At the very least, user-submitted versus internally-generated queries might be an interesting distinction. I don't have a concrete proposal for a different categorization than what we've got, but it seems worth considering while we still have the flexibility to change it easily. regards, tom lane