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

From Tom Lane
Subject Re: How to retain lesser paths at add_path()?
Date
Msg-id 2840.1564585637@sss.pgh.pa.us
Whole thread Raw
In response to How to retain lesser paths at add_path()?  (Kohei KaiGai <kaigai@heterodb.com>)
Responses Re: How to retain lesser paths at add_path()?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Kohei KaiGai <kaigai@heterodb.com> writes:
> When we add a new path using add_path(), it checks estimated cost and path-keys,
> then it also removes dominated paths, if any.
> Do we have a reasonable way to retain these "dominated" paths? Once it
> is considered
> lesser paths at a level, however, it may have a combined cheaper cost
> with upper pathnode.

You do *not* want to have add_path fail to remove dominated paths in
general.  Don't even think about it, because otherwise you will have
plenty of time to regret your folly while you wait for the planner
to chew through an exponential number of possible join plans.

What you'd want to do for something like the above, I think, is to
have some kind of figure of merit or other special marking for paths
that will have some possible special advantage in later planning
steps.  Then you can teach add_path that that's another dimension it
should consider, in the same way that paths with different sort orders
or parallizability attributes don't dominate each other.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Global temporary tables
Next
From: Alvaro Herrera
Date:
Subject: Re: Unused header file inclusion