mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
TrainedCostFunction.hpp
Go to the documentation of this file.
1#pragma once
2
5
6
7namespace m {
8
9struct TrainedCostFunction : CostFunctionCRTP<TrainedCostFunction>
10{
11 private:
12 std::unique_ptr<CostModel> filter_model_;
13 std::unique_ptr<CostModel> join_model_;
14 std::unique_ptr<CostModel> grouping_model_;
15
16 public:
17 TrainedCostFunction(std::unique_ptr<CostModel> filter_model, std::unique_ptr<CostModel> join_model,
18 std::unique_ptr<CostModel> grouping_model)
19 : filter_model_(std::move(filter_model))
20 , join_model_(std::move(join_model))
21 , grouping_model_(std::move(grouping_model)) {}
22
23 template<typename PlanTable>
24 double operator()(calculate_filter_cost_tag, PlanTable &&PT, const QueryGraph &G,
25 const CardinalityEstimator &CE, Subproblem sub, const cnf::CNF &condition) const;
26
27 template<typename PlanTable>
28 double operator()(calculate_join_cost_tag, PlanTable &&PT, const QueryGraph &G, const CardinalityEstimator &CE,
29 Subproblem left, Subproblem right, const cnf::CNF &condition) const;
30
31 template<typename PlanTable>
32 double operator()(calculate_grouping_cost_tag, PlanTable &&PT, const QueryGraph &G,
33 const CardinalityEstimator &CE, Subproblem sub,
34 const std::vector<const ast::Expr*> &group_by) const;
35};
36
37}
‍mutable namespace
Definition: Backend.hpp:10
STL namespace.
The query graph represents all data sources and joins in a graph structure.
Definition: QueryGraph.hpp:172
Implements a small and efficient set over integers in the range of 0 to 63 (including).
Definition: ADT.hpp:26
std::unique_ptr< CostModel > filter_model_
double operator()(calculate_filter_cost_tag, PlanTable &&PT, const QueryGraph &G, const CardinalityEstimator &CE, Subproblem sub, const cnf::CNF &condition) const
std::unique_ptr< CostModel > join_model_
std::unique_ptr< CostModel > grouping_model_
TrainedCostFunction(std::unique_ptr< CostModel > filter_model, std::unique_ptr< CostModel > join_model, std::unique_ptr< CostModel > grouping_model)
A CNF represents a conjunction of cnf::Clauses.
Definition: CNF.hpp:134