Re: How to retain lesser paths at add_path()?

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: How to retain lesser paths at add_path()?
Дата
Msg-id 20191006192313.42p5xltbphvr5fpk@development
обсуждение исходный текст
Ответ на Re: How to retain lesser paths at add_path()?  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: How to retain lesser paths at add_path()?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Fri, Oct 04, 2019 at 12:19:06PM -0400, Robert Haas wrote:
>On Mon, Aug 12, 2019 at 12:28 AM Kohei KaiGai <kaigai@heterodb.com> wrote:
>> For implementation of the concept, this patch puts a hook on add_path
>> / add_partial_path
>> to override the path removal decision by extensions, according to its
>> own viewpoint.
>
>I don't think this hook is a very useful approach to this problem, and
>I'm concerned that it might have a measurable performance cost.
>

Can you be more specific why you don't think this approach is not
useful? I'm not sure whether you consider all hooks to have this issue
or just this proposed one.

As for the performance impact, I think that's not difficult to measure.
I'd be surprised if it has measurable impact on cases with no hook
installed (there's plenty more expensive stuff going on). Of course, it
may have some impact for cases when the hook retains many more paths
and/or does something expensive, but that's kinda up to whoever writes
that particular hook. I think the assumption is that the savings from
building better plans far outweight that extra cost.

That does not necessarily mean the proposed hook is correct - I only
briefly looked at it, and it's not clear to me why would it be OK to
call the hook for remove_old=true but not also for accept_new=false? How
do we know whether the "better" path arrives first?


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services 



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Missed check for too-many-children in bgworker spawning
Следующее
От: Tom Lane
Дата:
Сообщение: Re: v12 and pg_restore -f-