Re: PG 18 JIT regression: int4range hash breaks multi-key GROUP BY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>, Tor Erik Linnerud <tel(at)jklm(dot)no>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: PG 18 JIT regression: int4range hash breaks multi-key GROUP BY
Date: 2026-11-17 23:42:23
Message-ID: 587841.1794958943@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David Rowley <dgrowleyml(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2026-11-17 23:49:00 Re: PG 18 JIT regression: int4range hash breaks multi-key GROUP BY
Previous Message David Rowley 2026-11-17 23:14:10 Re: PG 18 JIT regression: int4range hash breaks multi-key GROUP BY