![]() |
mutable
A Database System for Research and Fast Prototyping
|
#include <HeuristicSearchPlanEnumerator.hpp>
Data Structures | |
struct | Scratchpad |
struct | the_iterator |
Public Types | |
using | base_type = Base< EdgePtrBottomUp > |
using | size_type = typename base_type::size_type |
using | iterator = the_iterator< false > |
using | const_iterator = the_iterator< true > |
using | actual_type = ConcreteType |
Public Member Functions | |
EdgePtrBottomUp (const QueryGraph &) | |
Creates an initial state. | |
EdgePtrBottomUp (const EdgePtrBottomUp *parent, unsigned num_joins, double g, unsigned join_id) | |
Creates a state with actual costs g and given subproblems . | |
~EdgePtrBottomUp () | |
EdgePtrBottomUp (const EdgePtrBottomUp &)=delete | |
Copy c'tor. | |
EdgePtrBottomUp (EdgePtrBottomUp &&other) | |
Move c'tor. | |
EdgePtrBottomUp & | operator= (EdgePtrBottomUp other) |
Assignment. | |
template<typename PlanTable > | |
bool | is_goal (const PlanTable &, const QueryGraph &G, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &) const |
double | g () const |
void | decrease_g (double new_g) const |
const EdgePtrBottomUp * | parent () const |
unsigned | join_id () const |
unsigned | num_joins () const |
unsigned | num_joins_remaining (const QueryGraph &G) const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
template<typename Callback > | |
void | for_each_subproblem (Callback &&callback, const QueryGraph &G) const |
bool | operator== (const EdgePtrBottomUp &other) const |
Returns true iff this and other have the exact same joins. | |
bool | operator!= (const EdgePtrBottomUp &other) const |
void | compute_datasource_to_subproblem_index (const QueryGraph &G, Subproblem *subproblems, uint8_t *datasource_to_subproblem) const |
Computes the Subproblem s produced by the Join s of this state in subproblems . | |
void | dump (std::ostream &out) const |
void | dump () const |
bool | is_bottom (const PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF, const CardinalityEstimator &CE) const |
bool | is_top (const PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF, const CardinalityEstimator &CE) const |
double | decrease_g (const EdgePtrBottomUp *new_parent, double new_g) const |
Reduces the g value of the state. | |
bool | operator== (const Base &other) const |
bool | operator!= (const Base &other) const |
bool | operator< (const Base &other) const |
void | for_each_successor (Callback &&callback, PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF, const CardinalityEstimator &CE) const |
Returns true iff this and other have the exact same Subproblem s. | |
actual_type & | actual () |
const actual_type & | actual () const |
Static Public Member Functions | |
static EdgePtrBottomUp | CreateInitial (const QueryGraph &G, const AdjacencyMatrix &) |
static void | RESET_STATE_COUNTERS () |
static unsigned | NUM_STATES_GENERATED () |
static unsigned | NUM_STATES_EXPANDED () |
static unsigned | NUM_STATES_CONSTRUCTED () |
static unsigned | NUM_STATES_DISPOSED () |
static void | INCREMENT_NUM_STATES_GENERATED () |
static void | INCREMENT_NUM_STATES_EXPANDED () |
static void | INCREMENT_NUM_STATES_CONSTRUCTED () |
static void | INCREMENT_NUM_STATES_DISPOSED () |
static state_counters_t | STATE_COUNTERS () |
static state_counters_t | STATE_COUNTERS (state_counters_t new_counters) |
Private Attributes | |
double | g_ |
const EdgePtrBottomUp * | parent_ = nullptr |
unsigned | join_id_ |
unsigned | num_joins_ |
friend | CRTPBaseType< actual_type, TParams... > |
Static Private Attributes | |
static Scratchpad | scratchpad_ |
static state_counters_t | state_counters_ |
Friends | |
void | swap (EdgePtrBottomUp &first, EdgePtrBottomUp &second) |
M_LCOV_EXCL_START friend std::ostream & | operator<< (std::ostream &out, const EdgePtrBottomUp &S) |
Definition at line 872 of file HeuristicSearchPlanEnumerator.hpp.
|
inherited |
Definition at line 874 of file HeuristicSearchPlanEnumerator.hpp.
Definition at line 913 of file HeuristicSearchPlanEnumerator.hpp.
using m::pe::hs::search_states::EdgePtrBottomUp::iterator = the_iterator<false> |
Definition at line 912 of file HeuristicSearchPlanEnumerator.hpp.
using m::pe::hs::search_states::EdgePtrBottomUp::size_type = typename base_type::size_type |
Definition at line 875 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Creates an initial state.
Definition at line 978 of file HeuristicSearchPlanEnumerator.hpp.
References m::pe::hs::search_states::Base< EdgePtrBottomUp >::INCREMENT_NUM_STATES_CONSTRUCTED().
|
inline |
Creates a state with actual costs g
and given subproblems
.
Definition at line 986 of file HeuristicSearchPlanEnumerator.hpp.
References m::pe::hs::search_states::Base< EdgePtrBottomUp >::INCREMENT_NUM_STATES_CONSTRUCTED().
|
inline |
Definition at line 995 of file HeuristicSearchPlanEnumerator.hpp.
References m::pe::hs::search_states::Base< EdgePtrBottomUp >::INCREMENT_NUM_STATES_DISPOSED(), and parent_.
|
delete |
Copy c'tor.
|
inline |
|
inlineinherited |
Definition at line 52 of file crtp.hpp.
Referenced by m::pe::hs::search_states::Base< Actual >::operator!=(), m::pe::hs::search_states::Base< Actual >::operator<(), m::pe::hs::search_states::Base< Actual >::operator==(), and m::PlanTableBase< Actual >::operator==().
|
inlineinherited |
|
inline |
Definition at line 1033 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by cbegin().
|
inline |
Definition at line 1035 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 1037 of file HeuristicSearchPlanEnumerator.hpp.
References begin().
Referenced by m::pe::hs::expansions::BottomUpComplete::operator()(), std::hash< m::pe::hs::search_states::EdgePtrBottomUp >::operator()(), and operator==().
|
inline |
Definition at line 1038 of file HeuristicSearchPlanEnumerator.hpp.
References end().
|
inline |
Computes the Subproblem
s produced by the Join
s of this state in subproblems
.
Simultaniously, buils a reverse index that maps from DataSource
ID to Subproblem
in datasource_to_subproblem
.
Definition at line 1081 of file HeuristicSearchPlanEnumerator.hpp.
References m::SmallBitset::All(), m::SmallBitset::empty(), id, join_id(), m::QueryGraph::joins(), M_insist, m::QueryGraph::num_sources(), parent(), m::SmallBitset::Singleton(), and m::Join::sources().
Referenced by for_each_subproblem(), m::pe::hs::search_states::EdgePtrBottomUp::Scratchpad::make_owner(), and m::pe::hs::expansions::BottomUpComplete::operator()().
|
inlinestatic |
Definition at line 1009 of file HeuristicSearchPlanEnumerator.hpp.
References m::pe::hs::search_states::EdgePtrBottomUp::Scratchpad::is_allocated(), and scratchpad_.
|
inlineinherited |
Reduces the g value of the state.
Definition at line 160 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 1025 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 1134 of file HeuristicSearchPlanEnumerator.hpp.
References dump().
Referenced by dump().
|
inline |
Definition at line 1133 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 1034 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by cend(), for_each_subproblem(), and operator==().
|
inline |
Definition at line 1036 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 1041 of file HeuristicSearchPlanEnumerator.hpp.
References compute_datasource_to_subproblem_index(), end(), and m::QueryGraph::num_sources().
|
inlineinherited |
Returns true
iff this
and other
have the exact same Subproblem
s.
Calls callback
on every state reachable from this state by a single actions.
Definition at line 171 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 1024 of file HeuristicSearchPlanEnumerator.hpp.
References g_.
Referenced by m::pe::hs::expansions::BottomUpComplete::operator()().
|
inlinestaticinherited |
Definition at line 114 of file HeuristicSearchPlanEnumerator.hpp.
|
inlinestaticinherited |
Definition at line 115 of file HeuristicSearchPlanEnumerator.hpp.
|
inlinestaticinherited |
Definition at line 113 of file HeuristicSearchPlanEnumerator.hpp.
|
inlinestaticinherited |
Definition at line 112 of file HeuristicSearchPlanEnumerator.hpp.
|
inlineinherited |
Definition at line 141 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 1018 of file HeuristicSearchPlanEnumerator.hpp.
References num_joins(), and m::QueryGraph::num_sources().
|
inlineinherited |
Definition at line 148 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 1027 of file HeuristicSearchPlanEnumerator.hpp.
References join_id_, M_notnull, and parent_.
Referenced by compute_datasource_to_subproblem_index().
|
inline |
Definition at line 1028 of file HeuristicSearchPlanEnumerator.hpp.
References num_joins_.
Referenced by is_goal(), num_joins_remaining(), m::pe::hs::expansions::BottomUpComplete::operator()(), std::hash< m::pe::hs::search_states::EdgePtrBottomUp >::operator()(), and operator==().
|
inline |
Definition at line 1029 of file HeuristicSearchPlanEnumerator.hpp.
References num_joins(), and m::QueryGraph::num_sources().
|
inlinestaticinherited |
Definition at line 109 of file HeuristicSearchPlanEnumerator.hpp.
|
inlinestaticinherited |
Definition at line 110 of file HeuristicSearchPlanEnumerator.hpp.
|
inlinestaticinherited |
Definition at line 108 of file HeuristicSearchPlanEnumerator.hpp.
|
inlinestaticinherited |
Definition at line 107 of file HeuristicSearchPlanEnumerator.hpp.
|
inlineinherited |
Definition at line 165 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 1075 of file HeuristicSearchPlanEnumerator.hpp.
References operator==().
|
inlineinherited |
Definition at line 166 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
|
inlineinherited |
Definition at line 164 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Returns true
iff this
and other
have the exact same joins.
Definition at line 1055 of file HeuristicSearchPlanEnumerator.hpp.
References cbegin(), end(), and num_joins().
Referenced by operator!=().
|
inline |
Definition at line 1026 of file HeuristicSearchPlanEnumerator.hpp.
References parent_.
Referenced by compute_datasource_to_subproblem_index().
|
inlinestaticinherited |
Definition at line 106 of file HeuristicSearchPlanEnumerator.hpp.
|
inlinestaticinherited |
Definition at line 117 of file HeuristicSearchPlanEnumerator.hpp.
|
inlinestaticinherited |
Definition at line 118 of file HeuristicSearchPlanEnumerator.hpp.
|
friend |
Definition at line 1124 of file HeuristicSearchPlanEnumerator.hpp.
|
friend |
Definition at line 969 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by EdgePtrBottomUp(), and operator=().
|
privateinherited |
|
mutableprivate |
Definition at line 962 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by decrease_g(), and g().
|
private |
Definition at line 964 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by join_id().
|
private |
Definition at line 965 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by num_joins().
|
private |
Definition at line 963 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by join_id(), parent(), and ~EdgePtrBottomUp().
|
staticprivate |
Definition at line 959 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by CreateInitial().
|
staticprivateinherited |
Definition at line 103 of file HeuristicSearchPlanEnumerator.hpp.