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 CAApHDvqO38LRB+P-ET7PG2L_jEABC0z8qd08ND9wAXKKEOa3pA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant  (Richard Guo <guofenglinux@gmail.com>)
Список pgsql-hackers
On Thu, 27 Oct 2022 at 15:50, Richard Guo <guofenglinux@gmail.com> wrote:
> I find the duplicate "Limit" node is not that concerning after I realize
> it may appear in other queries, such as
>
> explain (analyze, timing off, costs off)
> select * from (select * from (select * from generate_series(1,100)i limit 10) limit 5) limit 1;

Yeah, the additional limits certainly are not incorrect.  We could
maybe do something better, there just does not seem to be much point.

Perhaps fixing things like this would be better done with the
UniqueKey stuff that Andy Fan and I were working on a while back.
With LIMIT 1 everything would become unique and there'd be no need to
add another LimitPath.

I've now pushed the patch after making a small adjustment to one of
the comments which mentions about rows being "indistinguishable by an
equality check".  I was made to think of the '-0.0'::float8 vs +0.0
case again and thought I'd better mention it for this patch.

Thanks for reviewing the patch.

David



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

Предыдущее
От: Jehan-Guillaume de Rorthais
Дата:
Сообщение: Re: Transparent column encryption
Следующее
От: Andrey Lepikhov
Дата:
Сообщение: Re: Fast COPY FROM based on batch insert