On Thu, 19 Feb 2026 at 20:07, Ants Aasma <[email protected]> wrote:
> I was thinking more along the lines of hashing together the pointer
> value and worker number. But something more deterministic would indeed
> be better. How about this?
>
> --- a/src/backend/executor/execGrouping.c
> +++ b/src/backend/executor/execGrouping.c
> @@ -201,3 +201,3 @@ BuildTupleHashTable(PlanState *parent,
>         MemoryContext oldcontext;
> -       uint32          hash_iv = 0;
> +       uint32          hash_iv = parent->plan->plan_node_id;

I can confirm that this fixes the issue. A standalone reproducer is here:

create table data as select random(1,1000000) from generate_series(1,10000000);
vacuum analyze data;
set enable_gathermerge = off;
explain analyze select distinct random from data;

Regards,
Ants Aasma


Reply via email to