3#include <mutable/mutable-config.hpp>
28 mutable bool needs_projection_ =
false;
45 template<
typename PlanTable>
46 std::pair<std::unique_ptr<Producer>, PlanTable> optimize_with_plantable(
QueryGraph &G)
const;
51 template<
typename PlanTable>
52 std::unique_ptr<Producer*[]> optimize_source_plans(
const QueryGraph &G, PlanTable &PT)
const;
56 template<
typename PlanTable>
57 void optimize_join_order(
const QueryGraph &G, PlanTable &PT)
const;
61 template<
typename PlanTable>
62 std::unique_ptr<Producer> construct_join_order(
const QueryGraph &G,
const PlanTable &PT,
63 const std::unique_ptr<
Producer*[]> &source_plans)
const;
67 std::unique_ptr<Producer> optimize_plan(
const QueryGraph &G, std::unique_ptr<Producer> plan,
71 static std::vector<cnf::CNF> optimize_filter(
cnf::CNF filter);
75 static std::vector<projection_type>
76 compute_projections_required_for_order_by(
const std::vector<projection_type> &projections,
77 const std::vector<order_type> &order_by);
QueryGraph::order_type order_type
Optimizer(const pe::PlanEnumerator &pe, const CostFunction &cf)
auto & plan_enumerator() const
std::unique_ptr< Producer > operator()(QueryGraph &G) const
Applies this optimizer to the given query graph G to compute an optimal logical operator tree.
auto & cost_function() const
QueryGraph::projection_type projection_type
std::vector< std::unique_ptr< const ast::Expr > > created_exprs_
additionally created expressions
const pe::PlanEnumerator & pe_
A Producer is an Operator that can be evaluated to a sequence of tuples.
The query graph represents all data sources and joins in a graph structure.
std::pair< std::reference_wrapper< const ast::Expr >, ThreadSafePooledOptionalString > projection_type
std::pair< std::reference_wrapper< const ast::Expr >, bool > order_type
true means ascending, false means descending
Implements a small and efficient set over integers in the range of 0 to 63 (including).
A CNF represents a conjunction of cnf::Clauses.
An interface for all plan enumerators.