From: Andrei Lepikhov <lepihov@gmail.com>
To: Tomas Vondra <tomas@vondra.me>
To: David Rowley <dgrowleyml@gmail.com>
Cc: tharakan@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
Cc: Alexander Korotkov <aekorotkov@gmail.com>
Subject: Re: BUG #18885: ERROR: corrupt MVNDistinct entry - 2
Date: Wed, 16 Apr 2025 08:57:08 +0200
Message-ID: <1ebbf4dc-2b7e-43b0-a1a5-c0d7799c9ef2@gmail.com> (raw)
In-Reply-To: <769393be-6fea-435e-8316-66546c6f4a49@vondra.me>
References: <18885-da51324078588253@postgresql.org>
<f485c85f-9796-467e-81fe-43e8127cbb35@vondra.me>
<CAApHDvocZCUhM9W9mJ39d6oQz7ePKoqFnao_347mvC-A7QatcQ@mail.gmail.com>
<048f142e-18eb-4416-b7c7-b1398e667b3c@gmail.com>
<769393be-6fea-435e-8316-66546c6f4a49@vondra.me>
On 4/15/25 15:16, Tomas Vondra wrote:
> On 4/15/25 11:41, Andrei Lepikhov wrote:
>> What do you think about that?
> Not sure we'd want to export GroupVarInfo in the current shape. It was
> meant for a short-lived local state (within a single function), which
> seems quite different from what RestrictInfo does.
>
> In any case, such rework seems out of scope for PG18 - it's much more
> than a fix for the bug.
Of course, it is not for PG 18. I'm working on further GROUP-BY
optimisation where columns are re-arranged in a way to put at the first
position column with maximum ndistinct estimation. Additional work is
needed that may be compensated by distinct caching.
One more ongoing project - correcting ndistinct estimation by passing
through the EquivalenceClass and looking for a minimum ndistinct. It
also needs a kinda cache. That's why I am pondering how to redefine
GroupVarInfo to reduce estimation efforts.
--
regards, Andrei Lepikhov
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: lepihov@gmail.com, tomas@vondra.me, dgrowleyml@gmail.com, noreply@postgresql.org, aekorotkov@gmail.com
Subject: Re: BUG #18885: ERROR: corrupt MVNDistinct entry - 2
In-Reply-To: <1ebbf4dc-2b7e-43b0-a1a5-c0d7799c9ef2@gmail.com>
* 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