From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Cc: Tor Erik Linnerud <tel@jklm.no>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: PG 18 JIT regression: int4range hash breaks multi-key GROUP BY
Date: Tue, 17 Nov 2026 18:42:23 -0500
Message-ID: <587841.1794958943@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvrJG82iGnZ_h2L_O+hoN+Mb5A1iAyePyp7s=W3oOEDy0Q@mail.gmail.com>
References: <CAEGP1v12rRmZo1h3KZ+ZCS66A9xLoSOuLAyBXu92nd97E3jJPw@mail.gmail.com>
<CAApHDvq1ExPa97Cx7XKpJaSo7==c9zfmksOy2jHMXVhVRweTZQ@mail.gmail.com>
<CAJTYsWVRHfdgVQAXg0cYZypBEO=4F8bJ5TpitpyqS1xofAm7Bg@mail.gmail.com>
<326861.1794926974@sss.pgh.pa.us>
<CAApHDvrJG82iGnZ_h2L_O+hoN+Mb5A1iAyePyp7s=W3oOEDy0Q@mail.gmail.com>
David Rowley <dgrowleyml@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, ayushtiwari.slg01@gmail.com, tel@jklm.no
Subject: Re: PG 18 JIT regression: int4range hash breaks multi-key GROUP BY
In-Reply-To: <587841.1794958943@sss.pgh.pa.us>
References: <CAEGP1v12rRmZo1h3KZ+ZCS66A9xLoSOuLAyBXu92nd97E3jJPw@mail.gmail.com> <CAApHDvq1ExPa97Cx7XKpJaSo7==c9zfmksOy2jHMXVhVRweTZQ@mail.gmail.com> <CAJTYsWVRHfdgVQAXg0cYZypBEO=4F8bJ5TpitpyqS1xofAm7Bg@mail.gmail.com> <326861.1794926974@sss.pgh.pa.us> <CAApHDvrJG82iGnZ_h2L_O+hoN+Mb5A1iAyePyp7s=W3oOEDy0Q@mail.gmail.com> <587841.1794958943@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox