Re: How to retain lesser paths at add_path()? - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: How to retain lesser paths at add_path()?
Date
Msg-id 20191006192313.42p5xltbphvr5fpk@development
Whole thread Raw
In response to Re: How to retain lesser paths at add_path()?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: How to retain lesser paths at add_path()?  (Robert Haas <robertmhaas@gmail.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Missed check for too-many-children in bgworker spawning
Next
From: Tom Lane
Date:
Subject: Re: v12 and pg_restore -f-