**Describe the situation**
There is a setting `optimize_move_functions_out_of_any` that is turn on by default.
It moves functions out of `any` aggregate function.
But it's not always beneficial.

Example:
```
any(substring(large_string, 1, 10))
```
is better than
```
substring(any(large_string), 1, 10)
```

/// We have rewritten this function. Just unwrap its argument.
    if (data.rewritten.count(ast.get()))
    {
        func_arguments[0]->setAlias(func.alias);
        ast = func_arguments[0];
        return;
    }
    std::unordered_set<ASTPtr *> identifiers; /// implicit remove duplicates
    if (!extractIdentifiers(func, identifiers))
        return;
    /// Wrap identifiers: any(f(x, y, g(z))) -> any(f(any(x), any(y), g(any(z))))
    for (auto * ast_to_change : identifiers)
    {
        ASTPtr e;
        *ast_to_change = makeASTFunction(func.name);
        (*ast_t);
    }
    data.rewritten.insert(ast.get());
    /// Unwrap function: any(f(any(x), any(y), g(any(z)))) -> f(any(x), any(y), g(any(z)))
    func_arguments[0]->setAlias(func.alias);
    ast = func_arguments[0];
}
bool RewriteAnyFunctionMatcher::needChildVisit(const ASTPtr & node, const ASTPtr &)
{
    return !node->as<ASTSubquery>() &&
        !node->as<ASTTableExpression>() &&
        !node->as<ASTArrayJoin>();
}
}