On 2014-12-03 11:30:32 +0000, Simon Riggs wrote: > I guess we need an Option node. Tom and I discussed that about an aeon ago. > > The Option node has a plan for each situation. At execution time, we > make the test specified in the plan and then select the appropriate > subplan. > > That way we can see what is happening in the plan and the executor > doesn't need to edit anything.
Given David's result where he noticed a performance impact due to the additional branch in the join code - which I still have a bit of a hard time to believe - it seems likely that a whole separate node that has to pass stuff around will be more expensive. I think the switch would actually have to be done in ExecInitNode() et al. David, if you essentially take your previous solution and move the if into ExecInitNode(), does it work well? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers