Re: Draft LIMIT pushdown to Append and MergeAppend patch

Поиск
Список
Период
Сортировка
От Michał Kłeczek
Тема Re: Draft LIMIT pushdown to Append and MergeAppend patch
Дата
Msg-id 7D291E0E-88FB-4E54-B0E6-AF519443C58A@kleczek.org
обсуждение исходный текст
Ответ на Re: Draft LIMIT pushdown to Append and MergeAppend patch  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Список pgsql-hackers


On 9 Oct 2023, at 15:04, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote:

On Mon, Oct 9, 2023 at 4:33 PM David Rowley <dgrowleyml@gmail.com> wrote:

What are there benefits if the paths are already ordered?  e.g if it's
an index scan then we'll only pull the tuples we need from it.


postgres_fdw creates a path with pathkeys based on the clauses on that
relation. There is no index involved there. Pushing down LIMIT will
limit the number of rows fetched from the foreign server and the
foreign server may have opportunity to optimize query based on the
LIMIT.

I would add another benefit:
opportunity to fetch everything early, buffer it and release the session.

Without limit information fdw has to keep cursors open.


Michal

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

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Draft LIMIT pushdown to Append and MergeAppend patch
Следующее
От: Amul Sul
Дата:
Сообщение: Re: ALTER COLUMN ... SET EXPRESSION to alter stored generated column's expression