Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant
Дата
Msg-id CAApHDvqyfo2i5jPQz7DjX=PwxP=_PHvo53aq=NPgO+B_8SKdCw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant  (Richard Guo <guofenglinux@gmail.com>)
Список pgsql-hackers
On Fri, 14 Oct 2022 at 15:15, Richard Guo <guofenglinux@gmail.com> wrote:
> The v3 patch looks good to me.

Thank you for looking at that.

One other thought I had about the duplicate "Limit" node in the final
plan was that we could make the limit clause an Expr like
LEAST(<existing limit clause>, 1).  That way we could ensure we get at
most 1 row, but perhaps less if the expression given in the LIMIT
clause evaluated to 0. This will still work correctly when the
existing limit evaluates to NULL. I'm still just not that keen on this
idea as it means still having to either edit the parse's limitCount or
store the limit details in a new field in PlannerInfo and use that
when making the final LimitPath. However, I'm still not sure doing
this is worth the extra complexity.

If nobody else has any thoughts on this or the patch in general, then
I plan to push it in the next few days.

David



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Some regression tests for the pg_control_*() functions
Следующее
От: "jacktby@gmail.com"
Дата:
Сообщение: confused with name in the pic