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 1jz7rK-0003Ip-91 for pgsql-general@arkaria.postgresql.org; Sat, 25 Jul 2020 00:16:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jz7rI-00077K-Sw for pgsql-general@arkaria.postgresql.org; Sat, 25 Jul 2020 00:16:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jz7rI-00077D-L6 for pgsql-general@lists.postgresql.org; Sat, 25 Jul 2020 00:16:12 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jz7rG-0005oH-Ia for pgsql-general@lists.postgresql.org; Sat, 25 Jul 2020 00:16:11 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id D60657DE; Fri, 24 Jul 2020 20:16:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 24 Jul 2020 20:16:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=O0zP4o0O1knN0q4uxAoBu3hu3SZ HpKZ9yeNDflRlQJ0=; b=Hcx4FVIHgMQ3lZ/T8bYZ2UYlsMqSnB8xpm0wcoY9V9G 6PqwDGTwyv0L49IrVje4mFPIj6h4aznx5Biwj4PMbGUBvMROlweXdY7So5uYq452 WwcKCLZnU9DH4D/EpJhwjOCCpkbPdm152V9RH9/MnBwpi0tkK3F6M17ISNSUCyhA YNsbK5uQ5xV8LlpsTUP1Iu9j2wxvzu7QdY+PPcJg8Ex084VJP+UEd7suoQqIpJcI K2ZYbhcHp4tF4mRYmROLzxPxMEaLarj9m/PCp0QaQmIznRqpB3aw+IK8bfFq1d2E yaAl+wGDet2ZNwUDaMgYtHFPmENlDN1rVb2M8XVPrdw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=O0zP4o 0O1knN0q4uxAoBu3hu3SZHpKZ9yeNDflRlQJ0=; b=ivhmzivKAl5syh2M3bEPUW VE0JlFiywuUixn9+TcxN6goZWDVeiYUh0Sdhdi3g70LGAu71MDhDXJba2pw5elpj 3TYXygWMwNg76mQnJencU42CC+oMSMMZAFVY40BJvfCBfan/j4vUHoydUiM+oOa8 LzJjHG3IlGWNaF2uaRdm51ISG6Ah9LkPQJpSRY79XmC4D95mmLMxl7iiWVr3PRYF lcIZzeMJ9gq2YHCkEZ2plULMtU84U50wG6MkmjRl+ZLXNubpXMxlG7EBrhe/D1er kyq1YWXEtudL+amzF0OsVQ/5dN731f5/tHLI0jcYyZi9GELxPsYXovNxvjzlWRuA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrheeggdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeffhfeu ffdunecukfhppeeijedrudeitddrvddujedrvdehtdenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdgu vg X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 980C43280059; Fri, 24 Jul 2020 20:16:07 -0400 (EDT) Date: Fri, 24 Jul 2020 17:16:05 -0700 From: Andres Freund To: Tom Lane Cc: David Rowley , Scott Ribe , PostgreSQL General Subject: Re: bad JIT decision Message-ID: <20200725001605.vrlncip4fx3esv3b@alap3.anarazel.de> References: <7736C40E-6DB5-4E7A-8FE3-4B2AB8E22793@elevated-dev.com> <629715.1595630222@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <629715.1595630222@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2020-07-24 18:37:02 -0400, Tom Lane wrote: > David Rowley writes: > > However, for now, you might just want to try raising various jit > > thresholds so that it only is enabled for more expensive plans. > > Yeah. I'm fairly convinced that the v12 defaults are far too low, > because we are constantly seeing complaints of this sort. I think the issue is more that we need to take into accoutn that the overhead of JITing scales ~linearly with the number of JITed expressions. And that's not done right now. I've had a patch somewhere that had a prototype implementation of changing the costing to be #expressions * some_cost, and I think that's a lot more accurate. Greetings, Andres Freund