| From: | Andres Freund <andres(at)anarazel(dot)de> |
|---|---|
| To: | Tor Erik Linnerud <tel(at)jklm(dot)no>, David Rowley <dgrowleyml(at)gmail(dot)com> |
| Cc: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: PG 18 JIT regression: int4range hash breaks multi-key GROUP BY |
| Date: | 2026-11-16 16:29:07 |
| Message-ID: | 2lro64uahvfmagsjhwi6a247f6clghgwzx6hjvgvf7nvhghpyq@3cv7dfccs7xe |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
Hi,
On 2026-11-16 12:26:36 +0100, Tor Erik Linnerud wrote:
> On 18.6, a hash aggregate grouping by an int4range column followed by
> another column is several hundred times slower than on 17 when JIT is used.
> Same data, official Docker images, jit_above_cost = 0:
>
> GROUP BY p, r, b (range not last):
> 17.12: 0.48 s
> 18.6: 188 s
>
> GROUP BY p, b, r (range last):
> 17.12: 0.45 s
> 18.6: 0.39 s
>
> With jit = off, 18.6 is fast.
>
> Likely cause: in llvmjit_expr.c, EEOP_HASHDATUM_NEXT32 combines the hash
> function's full 64-bit Datum. hash_range returns its hash via
> PG_RETURN_INT32, which sign-extends, and the next column's rotate then
> shifts those upper bits into the combined hash, wiping it. The interpreter
> truncates to 32 bits and is not affected.
That's obviously a bug. Presumably in
2024-08-20 adf97c15623 Speed up Hash Join by making ExprStates support hashing
CCing David.
Greetings,
Andres Freund
| From | Date | Subject | |
|---|---|---|---|
| Next Message | shihao zhong | 2026-11-16 17:10:08 | Re: PostgreSQL 18.6/17.11: standby PANIC on restart after VM truncation |
| Previous Message | Matheus Alcantara | 2026-11-16 16:07:34 | Re: BUG #19772: ERROR: corrupt MVNDistinct entry for GROUP BY c0, ROLLUP (abs(c0)) with ndistinct statistics |