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 1jz9MV-0006Ho-5G for pgsql-general@arkaria.postgresql.org; Sat, 25 Jul 2020 01:52:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jz9Ly-0001jA-8Q for pgsql-general@arkaria.postgresql.org; Sat, 25 Jul 2020 01:51:58 +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 1jz9Lw-0001j3-GZ for pgsql-general@lists.postgresql.org; Sat, 25 Jul 2020 01:51:58 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jz9Lp-0000eo-7a for pgsql-general@lists.postgresql.org; Sat, 25 Jul 2020 01:51:56 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 5C223432 for ; Fri, 24 Jul 2020 21:51:46 -0400 (EDT) Received: from imap35 ([10.202.2.85]) by compute3.internal (MEProxy); Fri, 24 Jul 2020 21:51:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm2; bh=w5RI5lRTYIJmytZUWszj0Sd76+40V+O PmxHW6HgzGTM=; b=KRFOp4tXD8RvRoKVaZoAFTNg7QovC3YewKOKMZmx6mqEnrr a7TkPa0ALENYIi6U8L7mCeAOUaHtXeSn3GEsoj7KYlL2gCL1Z82+AcvIndrWxL48 wGP3IjtEkH6UsG3+VBXj694+7WWWy5IAB4rOS3mhv3g8auqG0bFIh+UG75TKGNJi OdT9pHUIVWZqyXr3BYuIhxHs7gROxs9kTELA4PCpHFcepoCVQ0OH/Fc3DR4cL+aC Vi1HjT8bDWcKRSKi0O6HWVRx0PIAIKTDLwCMfWnuiYGlxDUIB6ACJZtTkY+qPkwP kCxpkx4JML215S2BCyWoXLA889OC/0s6WBWt+UQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=w5RI5l RTYIJmytZUWszj0Sd76+40V+OPmxHW6HgzGTM=; b=SB6wvDVaIqogOg6RvnXCPN EMaVICj1dhUieTROCHOQOflgjvmtvMvCoGTm7tk//6tMhlJhGhIFuZ6rxWWNfwIw qfeYRMxnnxCKOFRTfLEtW+xSbiCtsMFqIVcP1JFsMehGi27tfOmSYzpeFiC/zBHm 1T7MBixFwmiXqPVKovNuV2zl+QqlH4cQe7U/Op5oCWPJEd2p+dtGZS1vCHwVW3yF Q8kpde6FUelmZCVy+ENbQXbkxhODVVMiMjhLnrSvMvhQhyMMEpmTaCJg3J+Kv1ap uxTN+b6KIG3s5qQzL6qRjnArs5ZVyClsHgwRCmMcQIRc3C9346SlOIK9qaVczJpw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrheeggdehtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesthdtre dtreertdenucfhrhhomhepfdetnhgurhgvshcuhfhrvghunhgufdcuoegrnhgurhgvshes rghnrghrrgiivghlrdguvgeqnecuggftrfgrthhtvghrnhepteegvddvffeghfejteevte evfeegffduudffgedtueejvdejlefgveegudekfedvnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdrug gv X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4502714C008D; Fri, 24 Jul 2020 21:51:45 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-92-g11c785d-fm-20200721.004-g11c785d5 Mime-Version: 1.0 Message-Id: In-Reply-To: <559519F3-5285-4F2B-A88F-0067382761A7@elevated-dev.com> References: <7736C40E-6DB5-4E7A-8FE3-4B2AB8E22793@elevated-dev.com> <559519F3-5285-4F2B-A88F-0067382761A7@elevated-dev.com> Date: Fri, 24 Jul 2020 18:51:23 -0700 From: "Andres Freund" To: pgsql-general@lists.postgresql.org Subject: Re: bad JIT decision Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On Fri, Jul 24, 2020, at 15:32, Scott Ribe wrote: > > On Jul 24, 2020, at 4:26 PM, David Rowley wrote: > > > > It does not really take into account the cost of jitting. > > That is what I was missing. > > I read about JIT when 12 was pre-release; in re-reading after my post I > see that it does not attempt to estimate JIT cost. And in thinking > about it, I realize that would be next to impossible to anticipate how > expensive LLVM optimizstion was going to be. We certainly can do better than now. > In the case where a set of functions is replicated across partitions, > it would be possible to do them once, then project the cost of the > copies. Probably not - JITing functions separately is more expensive than doing them once... The bigger benefit there is to avoid optimizing functions that are likely to be the same. > Perhaps for PG 14 as better support for the combination of JIT > optimization and highly-partitioned data ;-) If I posted a few patches to test / address some of these issue, could you test them with your schema & querries? Regards, Andres