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 1nZLZg-0002lC-1l for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Mar 2022 23:48:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZLZe-0005z7-3I for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Mar 2022 23:48:30 +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 1nZLZd-0005yy-PQ for pgsql-hackers@lists.postgresql.org; Tue, 29 Mar 2022 23:48:29 +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 1nZLZb-0003Us-FY for pgsql-hackers@lists.postgresql.org; Tue, 29 Mar 2022 23:48:29 +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 22TNmL1r121717; Tue, 29 Mar 2022 19:48:21 -0400 From: Tom Lane To: David Rowley cc: Andres Freund , Robert Haas , Julien Rouhaud , Magnus Hagander , Justin Pryzby , PostgreSQL Hackers Subject: Re: Add parameter jit_warn_above_fraction In-reply-to: References: <20220225162304.GD9008@telsasoft.com> <20220321235048.wb3ymun6lbi33b2u@alap3.anarazel.de> <20220329100846.3iedk5ear3ewdi5j@jrouhaud> <20220329231641.ai3qrzpdo2vqvwix@alap3.anarazel.de> Comments: In-reply-to David Rowley message dated "Wed, 30 Mar 2022 12:41:41 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <121715.1648597701.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 29 Mar 2022 19:48:21 -0400 Message-ID: <121716.1648597701@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Wed, 30 Mar 2022 at 12:16, Andres Freund wrote: >> FWIW, that doesn't seem quite right - won't it stop JITing e.g. on the = inner >> side of a nested loop, just because it's cheap, even though that's wher= e the >> bulk of the benefits comes from? > Yeah, I think the total cost would need to be multiplied by the number > of times we expect to call that part of the plan. I've not yet sat > down to figure out if that's easy/cheap or hard/costly information to > obtain. As long as you don't need the info till the end of planning, it should be reasonably simple to determine. I'm not sure if we actually record the expected number of loops in the plan tree today, but the costing mechanisms certainly estimate that along the way, so we could store it if need be. regards, tom lane