Re: Question Regarding Merge Append and Parallel Execution of Index Scans on Partitioned Table

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Question Regarding Merge Append and Parallel Execution of Index Scans on Partitioned Table
Дата
Msg-id CAApHDvpgjbk4Nu8NMHjCAU4_suCJKR460CNOLy=BBxw6fgMmDw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Question Regarding Merge Append and Parallel Execution of Index Scans on Partitioned Table  (Ayush Vatsa <ayushvatsa1810@gmail.com>)
Ответы Re: Question Regarding Merge Append and Parallel Execution of Index Scans on Partitioned Table
Список pgsql-hackers
On Fri, 6 Jun 2025 at 01:47, Ayush Vatsa <ayushvatsa1810@gmail.com> wrote:
> A small follow-up question - Gather merge won't gather and merge the
> output from child in sorted order, but will always need an explicit Sort
> node beneath it to do so. Correct?

Incorrect. The input node to the Gather Merge needs to be sorted by
something, and the output of the Gather Merge will be sorted by the
same thing. Gather Merge handles putting the tuples that were gathered
by parallel workers back into the order they're meant to be in.

The Gather Merge's input node could be anything that provides sorted
output. Index Scan, Merge Join, Nested Loop, Group Aggregate, etc.
Have a look at [1]

David

[1] https://github.com/postgres/postgres/blob/master/src/test/regress/expected/select_parallel.out#L713



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