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 1qGJaR-0001nf-Ds for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jul 2023 13:27:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qGJaQ-0001Mw-CC for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jul 2023 13:27:26 +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 1qGJaQ-0001Mn-36 for pgsql-hackers@lists.postgresql.org; Mon, 03 Jul 2023 13:27:26 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qGJaN-001xFJ-RF for pgsql-hackers@postgresql.org; Mon, 03 Jul 2023 13:27:25 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 7029D2F9949D for ; Mon, 3 Jul 2023 15:27:23 +0200 (CEST) Received: from s980.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 5EB172E28979; Mon, 3 Jul 2023 15:27:23 +0200 (CEST) Received: from s473.loopia.se (unknown [172.22.191.6]) by s980.loopia.se (Postfix) with ESMTP id 5B9E02201574; Mon, 3 Jul 2023 15:27:23 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1] autolearn=disabled Received: from s979.loopia.se ([172.22.191.6]) by s473.loopia.se (s473.loopia.se [172.22.190.13]) (amavisd-new, port 10024) with UTF8LMTP id N2bPkLiWpUKm; Mon, 3 Jul 2023 15:27:23 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s979.loopia.se (Postfix) with ESMTPSA id AB02710BC4CE; Mon, 3 Jul 2023 15:27:22 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: Re: generic plans and "initial" pruning From: Daniel Gustafsson In-Reply-To: Date: Mon, 3 Jul 2023 15:27:22 +0200 Cc: Tom Lane , Alvaro Herrera , Andres Freund , David Rowley , Jacob Champion , PostgreSQL Hackers , Robert Haas Content-Transfer-Encoding: 7bit Message-Id: <9D23D8BB-83EE-451E-95C1-CF42ADB76869@yesql.se> References: <20221221101846.7zsi7lscnm5ediik@alvherre.pgsql> <1350682.1671635927@sss.pgh.pa.us> <4191508.1674157166@sss.pgh.pa.us> <349124.1674185509@sss.pgh.pa.us> <20230207180855.xy5m4puwh5gzd7xy@awork3.anarazel.de> <1274885.1680558101@sss.pgh.pa.us> To: Amit Langote X-Mailer: Apple Mail (2.3696.120.41.1.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 8 Jun 2023, at 16:23, Amit Langote wrote: > > Here is a new version. The local planstate variable in the hunk below is shadowing the function parameter planstate which cause a compiler warning: @@ -1495,18 +1556,15 @@ ExecEndPlan(PlanState *planstate, EState *estate) ListCell *l; /* - * shut down the node-type-specific query processing - */ - ExecEndNode(planstate); - - /* - * for subplans too + * Shut down the node-type-specific query processing for all nodes that + * were initialized during InitPlan(), both in the main plan tree and those + * in subplans (es_subplanstates), if any. */ - foreach(l, estate->es_subplanstates) + foreach(l, estate->es_inited_plannodes) { - PlanState *subplanstate = (PlanState *) lfirst(l); + PlanState *planstate = (PlanState *) lfirst(l); -- Daniel Gustafsson