Reactivate query flattening when the result set of the outer query has