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 1pIiY8-0007Q5-81 for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jan 2023 03:58:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pIiY6-0003hv-PJ for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jan 2023 03:58:42 +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 1pIiY6-0003hm-Bt for pgsql-hackers@lists.postgresql.org; Fri, 20 Jan 2023 03:58:42 +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 1pIiY3-0002aE-Ra for pgsql-hackers@postgresql.org; Fri, 20 Jan 2023 03:58:40 +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 30K3waSV352018; Thu, 19 Jan 2023 22:58:36 -0500 From: Tom Lane To: Amit Langote cc: Alvaro Herrera , Robert Haas , Jacob Champion , David Rowley , PostgreSQL-development Subject: Re: generic plans and "initial" pruning In-reply-to: References: <20221221101846.7zsi7lscnm5ediik@alvherre.pgsql> <1350682.1671635927@sss.pgh.pa.us> <4191508.1674157166@sss.pgh.pa.us> <349124.1674185509@sss.pgh.pa.us> Comments: In-reply-to Amit Langote message dated "Fri, 20 Jan 2023 12:52:07 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <352016.1674187116.1@sss.pgh.pa.us> Date: Thu, 19 Jan 2023 22:58:36 -0500 Message-ID: <352017.1674187116@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Amit Langote writes: > On Fri, Jan 20, 2023 at 12:31 PM Tom Lane wrote: >> It might be possible to incorporate this pointer into PlannedStmt >> instead of passing it separately. > Yeah, that would be less churn. Though, I wonder if you still hold > that PlannedStmt should not be scribbled upon outside the planner as > you said upthread [1]? Well, the whole point of that rule is that the executor can't modify a plancache entry. If the plancache itself sets a field in such an entry, that doesn't seem problematic from here. But there's other possibilities if that bothers you; QueryDesc could hold the field, for example. Also, I bet we'd want to copy it into EState for the main initialization recursion. regards, tom lane