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 1uVGlA-00GDFO-Dp for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Jun 2025 21:37:24 +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 1uVGl8-004iZa-Fz for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Jun 2025 21:37:23 +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 1uVGl8-004iZR-7S for pgsql-bugs@lists.postgresql.org; Fri, 27 Jun 2025 21:37:22 +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 1uVGl7-004LBw-0n for pgsql-bugs@lists.postgresql.org; Fri, 27 Jun 2025 21:37:21 +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 55RLbJGc2075250; Fri, 27 Jun 2025 17:37:19 -0400 From: Tom Lane To: Richard Guo cc: Alexander Lakhin , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18953: Planner fails to build plan for complex query with LATERAL references In-reply-to: <2056150.1751049350@sss.pgh.pa.us> References: <18953-1c9883a9d4afeb30@postgresql.org> <1268645.1749765012@sss.pgh.pa.us> <1499514.1749848324@sss.pgh.pa.us> <527134.1750087495@sss.pgh.pa.us> <835659.1750177751@sss.pgh.pa.us> <837b0dce-b2f3-4811-bccf-f42e8985d6e2@gmail.com> <3040798.1750617116@sss.pgh.pa.us> <3886446.1750703041@sss.pgh.pa.us> <1487176.1750963077@sss.pgh.pa.us> <2056150.1751049350@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 27 Jun 2025 14:35:50 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2075248.1751060239.1@sss.pgh.pa.us> Date: Fri, 27 Jun 2025 17:37:19 -0400 Message-ID: <2075249.1751060239@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ... BTW, looking at these two patches again, I wonder if it'd be better to put the hackery for SubLink conversion into identify_current_nestloop_params? That'd remove the need to argue that we don't have to fix both copies of a nestloop-parameter PHV. The responsibility doesn't clearly belong to identify_current_nestloop_params, but it doesn't clearly belong to create_nestloop_plan either, so neither choice seems superior from a modularity standpoint. regards, tom lane