#pragma once #include #include namespace DB { class ASTSelectQuery; /// Erases unnecessary ORDER BY from subquery class DuplicateOrderByFromSubqueriesData { public: using TypeToVisit = ASTSelectQuery; bool done = false; void visit(ASTSelectQuery & select_query, ASTPtr &); }; using DuplicateOrderByFromSubqueriesMatcher = OneTypeMatcher; using DuplicateOrderByFromSubqueriesVisitor = InDepthNodeVisitor; /// Finds SELECT that can be optimized class DuplicateOrderByData { public: using TypeToVisit = ASTSelectQuery; ContextPtr context; void visit(ASTSelectQuery & select_query, ASTPtr &); }; using DuplicateOrderByMatcher = OneTypeMatcher; using DuplicateOrderByVisitor = InDepthNodeVisitor; }