Reorders the extends, orderings, and filters between a query form and its group, as far as they commute,
so orderings become the ORDER BY clause and filters become HAVING conditions.
Filters that stay above the group are left for the own subquery of the group, see translateAlgPatternNew.
Param: op
The query form whose input is reordered.
Returns
the query form with its orderings on top and its filters on the group, or the given one if nothing moves.
Reorders the extends, orderings, and filters between a query form and its group, as far as they commute, so orderings become the ORDER BY clause and filters become HAVING conditions. Filters that stay above the group are left for the own subquery of the group, see translateAlgPatternNew.