Traqula docs
    Preparing search index...
    reorderAlgQueryChain: AstIndir<
        "reorderQueryChain",
        AlgQueryForm,
        [AlgQueryForm],
    > = ...

    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.

    The query form whose input is reordered.

    the query form with its orderings on top and its filters on the group, or the given one if nothing moves.