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 1pgzt6-0008R7-IC for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Mar 2023 03:20: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 1pgzt5-0004of-8X for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Mar 2023 03:20: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 1pgzt5-0004oV-0E for pgsql-bugs@lists.postgresql.org; Tue, 28 Mar 2023 03:20: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 1pgzsy-0007hx-Kc for pgsql-bugs@lists.postgresql.org; Tue, 28 Mar 2023 03:20:42 +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 32S3KUEX3386398; Mon, 27 Mar 2023 23:20:30 -0400 From: Tom Lane To: David Rowley cc: Andres Freund , maxim.boguk@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17871: JIT during postgresql_fdw remote_estimates EXPLAIN have very negatively effect on planning time In-reply-to: References: <17871-16521a70c16cb83c@postgresql.org> <20230327212830.dpp2u47je5ozf5q7@awork3.anarazel.de> <3348298.1679953099@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Tue, 28 Mar 2023 16:05:00 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3386396.1679973630.1@sss.pgh.pa.us> Date: Mon, 27 Mar 2023 23:20:30 -0400 Message-ID: <3386397.1679973630@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > I guess that means just add a check for EXEC_FLAG_EXPLAIN_ONLY in > jit_compile_expr, or only set the es_jit_flags bits in > standard_ExecutorStart() when not in EXEC_FLAG_EXPLAIN_ONLY. I'm not > really sure which of those is better, but the attached does the former > and seems to fix the issue. Hmm, offhand I'd vote for the latter, because it adds cycles only once per query not once per expression. But Andres may have a better idea about how to do this. regards, tom lane