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.98.2) (envelope-from ) id 1xTSor-00000000LL0-0M4N for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Nov 2026 23:42:33 +0000 Received: from localhost ([127.0.0.1]:51780 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xTSoq-00000007jPh-23TI for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Nov 2026 23:42:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:57008) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xTSoq-00000007jPZ-12Ag for pgsql-bugs@lists.postgresql.org; Tue, 17 Nov 2026 23:42:32 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xTSol-00000000FQF-18Sv for pgsql-bugs@lists.postgresql.org; Tue, 17 Nov 2026 23:42:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 6AHNgNai587842; Tue, 17 Nov 2026 18:42:23 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 6AHNgNai587842 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1794958943; bh=+HE/CFb6nriwcRQYxPgZVWng0+JaD/teEOGtDOQ/St4=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=C44T8+RUYz4+BXyJ5T836saw28ZKp6ZMrNaEAbKfSievSeWEo+Tgb43NeKXY4PYbc Vf3ZM/QZxZt0qBqzPIofDMb69rpMyQ2SX0szVmvaeMqwdbYFJf7hG/q2NEW78XRZ8v sv5b5edibuC3rxFJN0fvxvcuBNZ1CHLe6TLyPWDE= From: Tom Lane To: David Rowley cc: Ayush Tiwari , Tor Erik Linnerud , pgsql-bugs@lists.postgresql.org Subject: Re: PG 18 JIT regression: int4range hash breaks multi-key GROUP BY In-reply-to: References: <326861.1794926974@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Wed, 18 Nov 2026 12:14:10 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <587840.1794958942.1@sss.pgh.pa.us> Date: Tue, 17 Nov 2026 18:42:23 -0500 Message-ID: <587841.1794958943@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > IMO, the problems are: > 1) There is no way to get the hash value of an ExprState directly in > SQL; therefore; > 2) The only current way to test this is to create a test that checks > for slow performance or a Hash Aggregate or Hash Join, and doing that > is a terrible idea. > For #1, it might be possible to do a test module with a function like > CREATE FUNCTION test_hash_exprs(seed int4, strict bool, VARIADIC > "any") which takes the variadic args and uses ExecBuildHash32Expr() to > build an ExprState and returns the hashvalue / isnull result. I guess > then we could run that on a table with a few columns and insert into a > temp table, then run again with jit=1 and check the results match. > Perhaps the function could even create two ExprStates, one with a > faked-up PlanState to trick jit_compile_expr() into compiling the > expression when there's a JIT provider. It could then return both > values and allow the caller to compare them. > I had an LLM draft most of that up locally. I'm just wondering if it's > worth pursuing or not. I'd argue not ... regards, tom lane