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 1nZM4u-0004YL-5k for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Mar 2022 00:20:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZM4s-0007ja-20 for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Mar 2022 00:20:46 +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 1nZM4q-0007jR-5I for pgsql-hackers@lists.postgresql.org; Wed, 30 Mar 2022 00:20:45 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZM4h-0003kW-Jj for pgsql-hackers@lists.postgresql.org; Wed, 30 Mar 2022 00:20:43 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 78AC65C01B5; Tue, 29 Mar 2022 20:20:32 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 29 Mar 2022 20:20:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=wwk2hw0X42LsRSNcPJTREl8KnfTmq369tJpgTm bjER8=; b=hlO46B7HJ8ePEWkVAalIWtS8tsSnUjP868m71ElVKEk0Uqc5AIZRR+ cTZaak5nP1R0KWuZc/zQm95841xOJBUpPssepo2W9EAqNdbDZXAWuBx6K2X6vvtW OnBtVmUtptA7Q+ir2rBnbnNtzfJeSnTS5ZC5H+KRHpG97ygTbelaxV3WBC4/+h/6 i1OmccfnDdoYxs5hk1+IbJEdjwFngyi+95RtBRtJvcPiGevqd8UWG/mjpBQzrl8B XAZqXd4GzBpm4wI7L42BJOElGPR7UpQGfj6IYjpLIwS5QqatvNTatb1puZog/gW/ Q1G3EQgUKVCqlUOlFaLsxBPda2jvJhtQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=wwk2hw0X42LsRSNcP JTREl8KnfTmq369tJpgTmbjER8=; b=kW/1PfsVQeSsLjwCquCQgLW++8EQh/QTS lNekZCZ8Mttb3+hUG1qnRlPEfpfZBX6z1MIgsBeAPPjhjR1DnqajqjZHhVxaakVz 2oXeoC2Hs1blQVaFgPM8j3FLsOGzzGcz6svTEC6VwvggTGw+dGoQc7wMgCUqZuDp Vk/68VivRDHuqhiLSq61s8w/OAdqPJ2t3PFpFYDqdZwTWmGG1+SVLvuGOQdA9Oan TZ2oAldJs4ETGo5GLVRYd8F/xZGlgL0w5gAsnj088ZWFRB6Nd/hGTEKjRWbxqUZI 2BxMpkOY9KRIlgdB4PMBWaccvONrMqMQyL4dXlkaeNfZK/DShbTkA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeiuddgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedukefhkeelueegveetheelffffjeegleeuudelfeefuedtleffueejfffh ueffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Mar 2022 20:20:31 -0400 (EDT) Date: Tue, 29 Mar 2022 17:20:30 -0700 From: Andres Freund To: David Rowley Cc: Robert Haas , Julien Rouhaud , Magnus Hagander , Justin Pryzby , PostgreSQL Hackers Subject: Re: Add parameter jit_warn_above_fraction Message-ID: <20220330002030.fdfopirlsakhsg77@alap3.anarazel.de> References: <20220225162304.GD9008@telsasoft.com> <20220321235048.wb3ymun6lbi33b2u@alap3.anarazel.de> <20220329100846.3iedk5ear3ewdi5j@jrouhaud> <20220329231641.ai3qrzpdo2vqvwix@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-03-30 12:41:41 +1300, David Rowley wrote: > On Wed, 30 Mar 2022 at 12:16, Andres Freund wrote: > > > I did propose a patch to address this in [1]. It does need more work > > > and I do plan to come back to it for v16. > > > > 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 where 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. I wonder whether it'd make sense to combine that with awareness of a few plan types that can lead to large portions of child nodes never being executed. One the case where the current behaviour is the worst is runtime partition pruning in append - we compile expressions for whole subtrees that will never be executed. We should be much more hesitant to compile there compared to a cheap-ish node that we know will be executed as part of a large expensive part of the plan tree. - Andres