Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5WR0-003KoO-1j for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 22:10:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5WQy-00GzBP-31 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 22:10:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5WQy-00GzBA-1o for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 22:10:41 +0000 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5WQv-000000012Uv-43ZJ for pgsql-hackers@postgresql.org; Wed, 25 Mar 2026 22:10:40 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 084A43ECA1; Wed, 25 Mar 2026 22:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vondra.me; s=gm1; t=1774476633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ETT3I0dscqYNGV8vQ5sw9gY70ZUxCj0K0NvBjz0yxXY=; b=cg/bNvjQRfPJk02W4PGU83lT7Xa3Af9q7iGrJEwIhKPKxyMHvpjEPZSmqrw8dPjHzVa+0J iP3WPSg/vGovWV1wz1MmNPbF62n7E62CGijhkZ955faTHjCkOgiTwc8dE9vr2Rn80kzRjK yv+01K+2cjNnSX7txLh0Trz8TQuhvDF5kWYItKfPuqcvBg8YBYYkncUYz89tYQOlUzqYbI wF8B9pdu3JPtbOKI5Tgsk/dqwggpfnXLYLXJ+K2GU1RMkPsyXjntq5mHx9THxAcNPQoERR qrOALhm97MvzhBJ3aaFh9fPFZcoCgn00hh13y4qbNTgtP9NTrAHVRpPJ2kioAg== Message-ID: Date: Wed, 25 Mar 2026 23:10:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Change default of jit to off To: Andres Freund , Pierre Ducroquet Cc: Tom Lane , Jelte Fennema-Nio , Greg Sabino Mullane , Adrien Nayrat , Christoph Berg , Euler Taveira , =?UTF-8?Q?=C3=81lvaro_Herrera?= , PostgreSQL Hackers , Andreas Karlsson , Anthonin Bonnefoy , pgsql-hackers , Michael Banck References: <49490d8d-e8b9-497b-9a58-712daadb9ca9@anayrat.info> <5b5d04c3-e34e-4ae9-8b39-12b52e63154a@vondra.me> <1629115.1774023867@sss.pgh.pa.us> Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: tomas@vondra.me X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdehiedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomhepvfhomhgrshcugghonhgurhgruceothhomhgrshesvhhonhgurhgrrdhmvgeqnecuggftrfgrthhtvghrnheptedvfefgveffgfeuhfeuueeuteegffetleevueeivdevhfefhfehteejgedutedtnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfkphepkeeirdegledrvdefiedrvddtgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeekiedrgeelrddvfeeirddvtdegpdhhvghloheplgdutddrudefjedrtddrvdgnpdhmrghilhhfrhhomhepthhomhgrshesvhhonhgurhgrrdhmvgdpqhhiugeptdekgeetgeefgfevtedupdhmohguvgepshhmthhpohhuthdpnhgspghrtghpthhtohepudegpdhrtghpthhtoheprghnughrvghssegrnhgrrhgriigvlhdruggvpdhrtghpthhtohepphdrphhsqhhlsehpihhnrghrrghfrdhinhhfohdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrdhprgdruhhspdhrtghpthhtohepphhoshhtghhrvghssehjvghlthgvfhdrnhhlpdhrtghpthhtohephhhtrghmf hhiughssehgmhgrihhlrdgtohhmpdhrtghpthhtoheprggurhhivghnrdhnrgihrhgrthesrghnrgihrhgrthdrihhnfhho List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/24/26 22:56, Andres Freund wrote: > Hi, > > On 2026-03-23 06:33:33 +0000, Pierre Ducroquet wrote: >> Le vendredi 20 mars 2026 à 5:25 PM, Tom Lane a écrit : >> >>> Tomas Vondra writes: >>>> ISTM there's a clear consensus to get this committed for PG19, so >>>> barring objections I'll take care of that in the next couple days. >>>> Unless someone else wants to ... >>> >>> +1 >>> >>>> Another option would be to leave that for mid-beta, which is where we >>>> tweaked the io_method GUCs last year. But we did that to get some >>>> testing for 'worker' (in case we revert to 'sync'), and we don't need >>>> that for jit. >>> >>> Doesn't seem like something to change mid-beta. If it makes anyone >>> unhappy, we'd best find out sooner not later. >> >> I've not seen any feedback on my "counter"-proposal: switch >> jit_tuple_deforming to off by default. Sure, for the perfect llvmjit use >> cases this will reduce the performance benefits, but it will remove most if >> not all the problematic queries (for instance queries running on many >> partitions, adding/moving columns leading to explosions in compilation >> time...) Of course if there are other troublesome situations, I would love >> being proven wrong. > > I doubt that that addresses the problem in any meaningful way. In nearly all > the cases I've looked at expression compilation completely dominates the cost, > due to being instantiated for every partition etc. So I'm rather surprised to > see this claim? > That's my understanding too. I did search in the archives for performance issues related to JIT, and those are the first two I found: 1) https://www.postgresql.org/message-id/6191e1ee-d548-2a8c-d87d-dab63c05ad2e@code-sourcery.de 2) https://www.postgresql.org/message-id/flat/LEXPR01MB09897821BA2CDDB70225EF7BE79C0%40LEXPR01MB0989.DEUPRD01.PROD.OUTLOOK.DE Both have all the JIT stuff enabled, and the timings are dominated by Optimization: * Timing: Generation 15.707 ms, Inlining 4.688 ms, Optimization 652.021 ms, Emission 939.556 ms, Total 1611.973 ms * Timing: Generation 27.833 ms, Inlining 117.093 ms, Optimization 3917.001 ms, Emission 2027.251 ms, Total 6089.177 ms Or am I mistaken and it could still be due to deforming? It'd be a bit silly to disable jit_tuple_deforming=off, only to find it's not enough and have to disable more stuff for PG20. Furthermore, jit_tuple_deforming is marked as DEVELOPER_OPTIONS, and is not in the sample. Wouldn't that be a bit confusing/surprising, if we disable just that, as it's not in the sample? regards -- Tomas Vondra