"Colin 't Hart" <colinthart(at)gmail(dot)com> writes:
> Would these be difficult to build in?
Well, you'd have to worry about the ALL cases, as well as how to determine
whether you're actually getting a win (which would probably be rather
tough, really, as the choice would have to be made before we've fired up
any of the planner machinery that supports statistical estimation :-().
The code that plans this is in src/backend/optimizer/prep/prepunion.c.
regards, tom lane