Here is an attempted enhancement to the query planner that didn't work out.
But it seems good to save this change for historical reference, even if it
does not belong on the trunk.