Re: A cost issue in ORDER BY + LIMIT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A cost issue in ORDER BY + LIMIT
Дата
Msg-id 102404.1659802376@sss.pgh.pa.us
обсуждение исходный текст
Ответ на A cost issue in ORDER BY + LIMIT  (Paul Guo <paulguo@gmail.com>)
Список pgsql-hackers
Paul Guo <paulguo@gmail.com> writes:
> Postgres seems to always optimize ORDER BY + LIMIT as top-k sort.
> Recently I happened to notice
> that in this scenario the output tuple number of the sort node is not
> the same as the LIMIT tuple number.

No, it isn't, and your proposed patch is completely misguided.
The cost and rowcount estimates for a plan node are always written
on the assumption that the node is run to completion.

            regards, tom lane



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: `make check` doesn't pass on MacOS Catalina
Следующее
От: Tom Lane
Дата:
Сообщение: conchuela doesn't like gnu_printf anymore