![]() |
mutable
A Database System for Research and Fast Prototyping
|
#include <TrainedCostFunction.hpp>
Public Types | |
using | Subproblem = SmallBitset |
Public Member Functions | |
TrainedCostFunction (std::unique_ptr< CostModel > filter_model, std::unique_ptr< CostModel > join_model, std::unique_ptr< CostModel > grouping_model) | |
template<typename PlanTable > | |
double | operator() (calculate_filter_cost_tag, PlanTable &&PT, const QueryGraph &G, const CardinalityEstimator &CE, Subproblem sub, const cnf::CNF &condition) const |
template<typename PlanTable > | |
double | operator() (calculate_join_cost_tag, PlanTable &&PT, const QueryGraph &G, const CardinalityEstimator &CE, Subproblem left, Subproblem right, const cnf::CNF &condition) const |
template<typename PlanTable > | |
double | operator() (calculate_grouping_cost_tag, PlanTable &&PT, const QueryGraph &G, const CardinalityEstimator &CE, Subproblem sub, const std::vector< const ast::Expr * > &group_by) const |
template<typename PlanTable > | |
double | calculate_filter_cost (const QueryGraph &G, const PlanTable &PT, const CardinalityEstimator &CE, Subproblem sub, const cnf::CNF &condition) const |
Returns the total cost of performing a Filter operation. | |
template<typename PlanTable > | |
double | calculate_join_cost (const QueryGraph &G, const PlanTable &PT, const CardinalityEstimator &CE, Subproblem left, Subproblem right, const cnf::CNF &condition) const |
Returns the total cost of performing a Join operation. | |
template<typename PlanTable > | |
double | calculate_grouping_cost (const QueryGraph &G, const PlanTable &PT, const CardinalityEstimator &CE, Subproblem sub, const std::vector< const ast::Expr * > &group_by) const |
Returns the total cost of performing a Grouping operation. | |
Private Attributes | |
std::unique_ptr< CostModel > | filter_model_ |
std::unique_ptr< CostModel > | join_model_ |
std::unique_ptr< CostModel > | grouping_model_ |
Definition at line 9 of file TrainedCostFunction.hpp.
|
inherited |
Definition at line 41 of file CostFunction.hpp.
|
inline |
Definition at line 17 of file TrainedCostFunction.hpp.
|
inlineinherited |
Returns the total cost of performing a Filter operation.
Definition at line 53 of file CostFunction.hpp.
|
inlineinherited |
Returns the total cost of performing a Grouping operation.
Definition at line 70 of file CostFunction.hpp.
|
inlineinherited |
Returns the total cost of performing a Join operation.
Definition at line 61 of file CostFunction.hpp.
Referenced by m::pe::hs::goo_path_completion(), m::pe::hs::heuristics::bottomup_lookahead_cheapest< PlanTable, State >::operator()(), m::pe::hs::heuristics::GOO< PlanTable, State, BottomUp >::operator()(), m::pe::hs::expansions::BottomUpComplete::operator()(), and m::PlanTableBase< Actual >::update().
double TrainedCostFunction::operator() | ( | calculate_filter_cost_tag | , |
PlanTable && | PT, | ||
const QueryGraph & | G, | ||
const CardinalityEstimator & | CE, | ||
Subproblem | sub, | ||
const cnf::CNF & | condition | ||
) | const |
Definition at line 12 of file TrainedCostFunction.cpp.
References m::CardinalityEstimator::estimate_filter(), filter_model_, M_insist, and m::CardinalityEstimator::predict_cardinality().
double TrainedCostFunction::operator() | ( | calculate_grouping_cost_tag | , |
PlanTable && | PT, | ||
const QueryGraph & | G, | ||
const CardinalityEstimator & | CE, | ||
Subproblem | sub, | ||
const std::vector< const ast::Expr * > & | group_by | ||
) | const |
Definition at line 57 of file TrainedCostFunction.cpp.
References grouping_model_, m::CardinalityEstimator::predict_cardinality(), and m::CardinalityEstimator::predict_number_distinct_values().
double TrainedCostFunction::operator() | ( | calculate_join_cost_tag | , |
PlanTable && | PT, | ||
const QueryGraph & | G, | ||
const CardinalityEstimator & | CE, | ||
Subproblem | left, | ||
Subproblem | right, | ||
const cnf::CNF & | condition | ||
) | const |
Definition at line 30 of file TrainedCostFunction.cpp.
References m::and, m::CardinalityEstimator::estimate_join(), join_model_, M_insist, m::CardinalityEstimator::predict_cardinality(), and m::CardinalityEstimator::predict_number_distinct_values().
|
private |
Definition at line 12 of file TrainedCostFunction.hpp.
Referenced by operator()().
|
private |
Definition at line 14 of file TrainedCostFunction.hpp.
Referenced by operator()().
|
private |
Definition at line 13 of file TrainedCostFunction.hpp.
Referenced by operator()().