From: | Tomas Vondra <tomas(at)vondra(dot)me> |
---|---|
To: | tharakan(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, PG Bug reporting form <noreply(at)postgresql(dot)org> |
Cc: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
Subject: | Re: BUG #18885: ERROR: corrupt MVNDistinct entry - 2 |
Date: | 2025-04-09 22:47:43 |
Message-ID: | f485c85f-9796-467e-81fe-43e8127cbb35@vondra.me |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On 4/9/25 15:46, PG Bug reporting form wrote:
> The following bug has been logged on the website:
>
> Bug reference: 18885
> Logged by: Robins Tharakan
> Email address: tharakan(at)gmail(dot)com
> PostgreSQL version: Unsupported/Unknown
> Operating system: Ubuntu
> Description:
>
> The following SQL triggers "ERROR: corrupt MVNDistinct entry", however this
> seems to be unrelated to a recent bugfix[1] for a similar issue (thus '2' in
> the $SUBJECT).
>
> The surfacing commit appears to be 6bb6a62f3cc45624c601d5270673a17447734629
> [2].
>
Thanks for the report. I only looked at this very briefly, but I agree
this seems to be a bug in 6bb6a62f3cc45624c601d5270673a17447734629,
because it simply ignores the possibility that multiple join clauses
could share the same Var. Which is the case in the reproducer, where the
join clause is simply
... ON (e.d=f.d) AND (e.d=f.d);
Which then leads to confusion when matching the MVDistinct entries.
I think estimate_multivariate_bucketsize() needs to be more careful
about building the GroupVarInfo list - in particular, it needs to do the
dance with examine_variable + add_unique_group_var + pull_var_clause,
similar to estimate_num_groups() at line ~3532.
regards
--
Tomas Vondra
From | Date | Subject | |
---|---|---|---|
Next Message | PG Bug reporting form | 2025-04-09 23:04:20 | BUG #18886: identity duplicate key |
Previous Message | Carrie Ray | 2025-04-09 18:31:33 | Help Please! |