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 1pXpHF-0003Q5-9E for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Mar 2023 20:11:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pXpGF-0007Vs-Sx for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Mar 2023 20:10:43 +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 1pXpGF-0007Vj-Jb for pgsql-hackers@lists.postgresql.org; Thu, 02 Mar 2023 20:10:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXpG7-00024U-8f for pgsql-hackers@postgresql.org; Thu, 02 Mar 2023 20:10:43 +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 322KAV7j2134062; Thu, 2 Mar 2023 15:10:31 -0500 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org Subject: Re: Evaluate arguments of correlated SubPlans in the referencing ExprState In-reply-to: <20230302200549.l2ikytmnqzvy5a7a@alap3.anarazel.de> References: <20230225214401.346ancgjqc3zmvek@awork3.anarazel.de> <2129737.1677785615@sss.pgh.pa.us> <20230302200549.l2ikytmnqzvy5a7a@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 02 Mar 2023 12:05:49 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2134060.1677787831.1@sss.pgh.pa.us> Date: Thu, 02 Mar 2023 15:10:31 -0500 Message-ID: <2134061.1677787831@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2023-03-02 14:33:35 -0500, Tom Lane wrote: >> I looked through this, and there is one point that is making me really >> uncomfortable. This bit is assuming that we can bind the address of >> the es_param_exec_vals array right into the compiled expression: > Yea, I wasn't super comfortable with that either. I concluded it's ok > because we already cache pointers to the array inside each ExprContext. ExprContext, sure, but compiled expressions? Considering what it costs to JIT those, I think we ought to be trying to make them fairly long-lived. regards, tom lane