How would you infer the optimization? I sounds like the derived query will be more useful when the original query contains having/group by. Perhaps that is when the builder should use a derived query?