On Mon, 9 Nov 2026 at 20:34, David Geier <[email protected]> wrote:
>
> > Committed
> > v11-0001-Use-branchless-comparisons-in-btint4cmp-and-btin.patch, since
> > that one seems uncontroversial. Thanks!
>
> Thanks!
>
> >> In the case of btint4cmp(), it's only ever invoked from the function
> >> manager, where it cannot be inlined.
> >>
> >> Or are there ways to invoke btint4cmp() that can be inlined, which I'm
> >> unaware of?
> >
> > JIT compilation, maybe? Unless someone shows that there's a measurable
> > problem though, I wouldn't worry about it.
>
> Yes, but I reasoned that when inlined via JIT it's not used by a
> sort_template.h
>
> --
> David Geier
>
>


Hi! I think there is a regression with numeric[]. Equal numeric values
can have different scales, so e.g. 1, 1.0 have different byte images.
The RB-tree accumulator combines them by comparator equality while the
hash keeps a separate entry for each image.

example (no pg_trgm extension required):

SET max_parallel_maintenance_workers = 0;
SET maintenance_work_mem = '256MB';
CREATE TABLE numeric_many AS
SELECT i, ARRAY[round((i%100)::numeric, ((i/100)%256)::int)] AS a
FROM generate_series(1,1000000) AS i;
VACUUM (FREEZE, ANALYZE) numeric_many;
SELECT count(*), count(DISTINCT a[1]),
       count(DISTINCT encode(numeric_send(a[1]),'hex')) FROM numeric_many;


in my run size of patch index is 7.3532338308457711x bigger and build
time is 4.0799353308331456x longer

-- 
Best regards,
Kirill Reshke


Reply via email to