Kohei KaiGai <kai...@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