![]() |
mutable
A Database System for Research and Fast Prototyping
|
#include <CardinalityEstimator.hpp>
Data Structures | |
struct | data_model_exception |
data_model_exception is thrown if a DataModel implementation does not contain the requested information. More... | |
Public Types | |
using | group_type = std::pair< std::reference_wrapper< const ast::Expr >, ThreadSafePooledOptionalString > |
Public Member Functions | |
virtual | ~CardinalityEstimator ()=0 |
virtual std::unique_ptr< DataModel > | empty_model () const =0 |
Returns a DataModel representing the empty set. | |
virtual std::unique_ptr< DataModel > | estimate_scan (const QueryGraph &G, Subproblem P) const =0 |
Creates a DataModel for a single DataSource . | |
virtual std::unique_ptr< DataModel > | estimate_filter (const QueryGraph &G, const DataModel &data, const cnf::CNF &filter) const =0 |
Applies a filter to a DataModel . | |
virtual std::unique_ptr< DataModel > | estimate_limit (const QueryGraph &G, const DataModel &data, const std::size_t limit, const std::size_t offset) const =0 |
Extracts a subset from a DataModel . | |
virtual std::unique_ptr< DataModel > | estimate_grouping (const QueryGraph &G, const DataModel &data, const std::vector< group_type > &groups) const =0 |
Groups data in the DataModel . | |
virtual std::unique_ptr< DataModel > | estimate_join (const QueryGraph &G, const DataModel &left, const DataModel &right, const cnf::CNF &condition) const =0 |
Form a new DataModel by joining two DataModel s. | |
template<typename PlanTable > | |
std::unique_ptr< DataModel > | estimate_join_all (const QueryGraph &G, const PlanTable &PT, Subproblem to_join, const cnf::CNF &condition) const |
Compute a DataModel for the result of joining all DataSource s in to_join by condition . | |
virtual std::size_t | predict_cardinality (const DataModel &data) const =0 |
virtual double | predict_number_distinct_values (const DataModel &data) const |
M_LCOV_EXCL_STOP void | dump (std::ostream &out) const |
void | dump () const |
Protected Member Functions | |
virtual void | print (std::ostream &out) const =0 |
Friends | |
M_LCOV_EXCL_START friend std::ostream & | operator<< (std::ostream &out, const CardinalityEstimator &CE) |
Definition at line 56 of file CardinalityEstimator.hpp.
using m::CardinalityEstimator::group_type = std::pair<std::reference_wrapper<const ast::Expr>, ThreadSafePooledOptionalString> |
Definition at line 59 of file CardinalityEstimator.hpp.
|
pure virtual |
Definition at line 41 of file CardinalityEstimator.cpp.
void CardinalityEstimator::dump | ( | ) | const |
M_LCOV_EXCL_START void CardinalityEstimator::dump | ( | std::ostream & | out | ) | const |
Definition at line 49 of file CardinalityEstimator.cpp.
References print().
|
pure virtual |
Returns a DataModel
representing the empty set.
|
pure virtual |
Applies a filter to a DataModel
.
data | the DataModel describing the incoming data |
filter | the condition of the filter as cnf::CNF |
DataModel
describing the outcoming, i.e. filtered, data Referenced by m::TrainedCostFunction::operator()().
|
pure virtual |
|
pure virtual |
Form a new DataModel
by joining two DataModel
s.
left | the DataModel describing the data coming from the left input |
right | the DataModel describing the data coming from the right input |
condition | the join condition as cnf::CNF |
DataModel
describing the join result Referenced by m::pe::GOO::for_each_join(), IKKBZ::linearize(), m::TrainedCostFunction::operator()(), m::pe::hs::heuristics::bottomup_lookahead_cheapest< PlanTable, State >::operator()(), m::pe::hs::expansions::BottomUpComplete::operator()(), and m::PlanTableBase< Actual >::update().
|
inline |
Compute a DataModel
for the result of joining all DataSource
s in to_join
by condition
.
Definition at line 128 of file CardinalityEstimator.hpp.
Referenced by m::pe::TDGOO::for_each_join(), m::pe::hs::heuristics::avg_sel< PlanTable, State, BottomUp >::operator()(), and m::pe::hs::expansions::TopDownComplete::operator()().
|
pure virtual |
|
pure virtual |
Creates a DataModel
for a single DataSource
.
G | the QueryGraph of the query |
P | the Subproblem to be scanned, must identify a single DataSource |
DataModel
of the scan result
|
pure virtual |
Referenced by m::pe::GOO::for_each_join(), m::pe::TDGOO::for_each_join(), IKKBZ::linearize(), m::CostFunctionCout::operator()(), m::TrainedCostFunction::operator()(), m::pe::hs::heuristics::product< PlanTable, State, BottomUp >::operator()(), m::pe::hs::heuristics::avg_sel< PlanTable, State, BottomUp >::operator()(), m::pe::hs::heuristics::sum< PlanTable, State, BottomUp >::operator()(), m::pe::hs::heuristics::scaled_sum< PlanTable, State, BottomUp >::operator()(), m::pe::hs::heuristics::bottomup_lookahead_cheapest< PlanTable, State >::operator()(), m::pe::hs::heuristics::GOO< PlanTable, State, TopDown >::operator()(), m::pe::hs::expansions::BottomUpComplete::operator()(), and m::pe::hs::expansions::TopDownComplete::operator()().
|
virtual |
Definition at line 43 of file CardinalityEstimator.cpp.
Referenced by m::TrainedCostFunction::operator()().
|
protectedpure virtual |
Referenced by dump().
|
friend |
Definition at line 147 of file CardinalityEstimator.hpp.