Re: Issue with query_is_distinct_for() and grouping sets - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Issue with query_is_distinct_for() and grouping sets
Date
Msg-id CAMbWs48-jA654k+UKZ-S2Pym1bcQQtMLxC=DAzKJGcL_yOE09w@mail.gmail.com
Whole thread Raw
In response to Re: Issue with query_is_distinct_for() and grouping sets  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Issue with query_is_distinct_for() and grouping sets
List pgsql-hackers
On Thu, Oct 23, 2025 at 12:07 PM David Rowley <dgrowleyml@gmail.com> wrote:
> Or if it's a case of it returning false when it could have returned
> true, then maybe the commit message should make that clear. I'm unable
> to tell from reading it. Something like; "The previous logic in
> query_is_distinct_for() was incomplete [as it failed to detect that a
> query was distinct when ...]".

It's the case of failing to recognize distinctness when it actually
holds (i.e., a false negative).  Therefore, this issue does not cause
incorrect results, but rather leads to missed optimization
opportunities.

How about using the following wording in the commit message?

"
The previous logic in query_is_distinct_for() was incomplete because
the check was insufficiently thorough and could return false when it
should have returned true.
"

- Richard



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [Proposal] Adding callback support for custom statistics kinds
Next
From: Amit Kapila
Date:
Subject: Re: issue with synchronized_standby_slots