Re: Short-circuit sort_inner_and_outer if there are no mergejoin clauses

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: Short-circuit sort_inner_and_outer if there are no mergejoin clauses
Дата
Msg-id CAMbWs4_B=C-KaD+VGuXa61XKzJa-9F+tFw4JQDdN-Ztnuxj3bA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Short-circuit sort_inner_and_outer if there are no mergejoin clauses  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Список pgsql-hackers

On Thu, Apr 25, 2024 at 7:25 PM Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote:
Quickly looking at the function, the patch would make it more apparent that the function is a noop when mergeclause_list is empty.

Thanks for looking at this patch.  Yes, that's what it does.
 
I haven't looked closely to see if creating unique path nonetheless is useful somewhere else.

It seems that one of the side effects of create_unique_path is that it
caches the generated unique path so that we can avoid creating it
repeatedly for the same rel.  But this does not seem to justify calling
create_unique_path when we know it is unnecessary. 

Please add to the next commitfest.

Done.
 
If the patch shows some measurable performance improvement, it would become more attractive.

I doubt that there is measurable performance improvement.  But I found
that throughout the run of the regression tests, sort_inner_and_outer is
called a total of 44,424 times.  Among these calls, there are 11,064
instances where mergeclause_list is found to be empty.  This accounts
for ~1/4.  I think maybe this suggests that it's worth the shortcut as
the patch does.

Thanks
Richard 
 

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Sequence Access Methods, round two
Следующее
От: Frédéric Yhuel
Дата:
Сообщение: Re: New GUC autovacuum_max_threshold ?