Re: Some revises in adding sorting path

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Some revises in adding sorting path
Дата
Msg-id CAApHDvo6T4nMWu0KuiEmbPzaSHC6py3Ndd=oaU7WCz4wAN4nug@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Some revises in adding sorting path  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: Some revises in adding sorting path
Список pgsql-hackers
On Mon, 29 Jan 2024 at 22:39, Richard Guo <guofenglinux@gmail.com> wrote:
> So in the v3 patch I've brought back the logic that considers
> incremental sort on partial paths in gather_grouping_paths().  However,
> I failed to compose a test case for this scenario without having to
> generate a huge table.  So in the v3 patch I did not include a test case
> for this aspect.

Can you share the test with the huge table?

I tried and failed as, if I'm not mistaken, you're talking about a
parallel aggregate query with an incremental sort between the Partial
Aggregate node and the Finalize Group Aggregate node.  If the partial
aggregate was a Group Aggregate, then it would already be correctly
sorted.  We don't need a more strict sort ordering to perform the
Finalize Group Aggregate, the results must already be sorted by at
least the GROUP BY clause.  If the partial aggregate had opted to Hash
Aggregate, then there'd be no presorted keys, so we could only get a
full sort.  I can't see any way to get an incremental sort between the
2 aggregate phases.

What am I missing?

I also tried reverting your changes to planner.c to see if your new
tests would fail. They all passed. So it looks like none of these
tests are testing anything new.

David



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

Предыдущее
От: Oleg Tselebrovskiy
Дата:
Сообщение: Re: Returning non-terminated string in ECPG Informix-compatible function
Следующее
От: Alexander Kuzmenkov
Дата:
Сообщение: Re: Incorrect cost for MergeAppend