On Fri, 2024-08-30 at 07:33 -0400, Robert Haas wrote: > This is a fair point. I dislike the fact that add_path() is a thicket > of if-statements that's actually quite hard to understand and easy to > screw up when you're making modifications. But I feel like it would > be > difficult to generalize the infrastructure without making it > substantially slower, which would probably cause too much of an > increase in planning time to be acceptable. So my guess is that this > is a dead end, unless there's a clever idea that I'm not seeing.
As far as performance goes, I'm only looking at branch in add_path() that calls compare_pathkeys(). Do you have some example queries which would be a worst case for that path? In general if you can post some details about how you are measuring, that would be helpful. Regards, Jeff Davis