![]() |
mutable
A Database System for Research and Fast Prototyping
|
#include <HeuristicSearchPlanEnumerator.hpp>
Public Types | |
using | base_type = Base< EdgesBottomUp > |
using | allocator_type = boost::container::node_allocator< unsigned > |
using | size_type = typename base_type::size_type |
using | iterator = unsigned * |
using | const_iterator = const unsigned * |
using | actual_type = ConcreteType |
Public Member Functions | |
EdgesBottomUp ()=default | |
EdgesBottomUp (size_type num_joins_to_goal, double g, size_type num_joins, unsigned *joins) | |
Creates a state with actual costs g and given subproblems . | |
EdgesBottomUp (size_type num_joins_to_goal, size_type num_joins, unsigned *joins) | |
Creates an initial state with the given subproblems . | |
template<typename It > | |
EdgesBottomUp (size_type num_joins_to_goal, double g, It begin, It end) | |
Creates a state with actual costs g and subproblems in range [begin; end) . | |
EdgesBottomUp (const EdgesBottomUp &other) | |
Copy c'tor. | |
EdgesBottomUp (EdgesBottomUp &&other) | |
Move c'tor. | |
EdgesBottomUp & | operator= (EdgesBottomUp other) |
Assignment. | |
~EdgesBottomUp () | |
D'tor. | |
template<typename PlanTable > | |
bool | is_goal (const PlanTable &, const QueryGraph &, const AdjacencyMatrix &, const CostFunction &, const CardinalityEstimator &) const |
double | g () const |
void | decrease_g (double new_g) const |
size_type | num_joins () const |
size_type | num_subproblems (const QueryGraph &G) const |
size_type | num_joins_to_goal () const |
unsigned | operator[] (std::size_t idx) 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 EdgesBottomUp &other) const |
Returns true iff this and other have the exact same joins. | |
bool | operator!= (const EdgesBottomUp &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 |
const EdgesBottomUp * | parent () 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 EdgesBottomUp *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 allocator_type & | get_allocator () |
| |
static EdgesBottomUp | 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 | |
size_type | num_joins_to_goal_ = 0 |
| |
double | g_ |
| |
size_type | num_joins_ = 0 |
| |
unsigned * | joins_ = nullptr |
| |
friend | CRTPBaseType< actual_type, TParams... > |
Static Private Attributes | |
static allocator_type | allocator_ |
| |
static state_counters_t | state_counters_ |
Friends | |
void | swap (EdgesBottomUp &first, EdgesBottomUp &second) |
M_LCOV_EXCL_START friend std::ostream & | operator<< (std::ostream &out, const EdgesBottomUp &S) |
Definition at line 638 of file HeuristicSearchPlanEnumerator.hpp.
|
inherited |
using m::pe::hs::search_states::EdgesBottomUp::allocator_type = boost::container::node_allocator<unsigned> |
Definition at line 641 of file HeuristicSearchPlanEnumerator.hpp.
Definition at line 640 of file HeuristicSearchPlanEnumerator.hpp.
using m::pe::hs::search_states::EdgesBottomUp::const_iterator = const unsigned* |
Definition at line 644 of file HeuristicSearchPlanEnumerator.hpp.
using m::pe::hs::search_states::EdgesBottomUp::iterator = unsigned* |
Definition at line 643 of file HeuristicSearchPlanEnumerator.hpp.
using m::pe::hs::search_states::EdgesBottomUp::size_type = typename base_type::size_type |
Definition at line 642 of file HeuristicSearchPlanEnumerator.hpp.
|
default |
Referenced by CreateInitial().
|
inline |
Creates a state with actual costs g
and given subproblems
.
Definition at line 677 of file HeuristicSearchPlanEnumerator.hpp.
References cbegin(), cend(), m::pe::hs::search_states::Base< EdgesBottomUp >::INCREMENT_NUM_STATES_CONSTRUCTED(), joins_, M_insist, and num_joins_.
|
inline |
Creates an initial state with the given subproblems
.
Definition at line 693 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Creates a state with actual costs g
and subproblems in range [begin; end)
.
Definition at line 699 of file HeuristicSearchPlanEnumerator.hpp.
References begin(), cbegin(), cend(), end(), m::pe::hs::search_states::Base< EdgesBottomUp >::INCREMENT_NUM_STATES_CONSTRUCTED(), M_insist, and num_joins_.
|
inlineexplicit |
Copy c'tor.
Definition at line 715 of file HeuristicSearchPlanEnumerator.hpp.
References begin(), cbegin(), cend(), end(), m::pe::hs::search_states::Base< EdgesBottomUp >::INCREMENT_NUM_STATES_CONSTRUCTED(), joins_, M_insist, and num_joins_.
|
inline |
|
inline |
D'tor.
Definition at line 737 of file HeuristicSearchPlanEnumerator.hpp.
References allocator_, m::pe::hs::search_states::Base< EdgesBottomUp >::INCREMENT_NUM_STATES_DISPOSED(), joins_, M_insist, and num_joins_.
|
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 773 of file HeuristicSearchPlanEnumerator.hpp.
References joins_.
Referenced by cbegin(), EdgesBottomUp(), and end().
|
inline |
Definition at line 775 of file HeuristicSearchPlanEnumerator.hpp.
References joins_.
|
inline |
Definition at line 777 of file HeuristicSearchPlanEnumerator.hpp.
References begin().
Referenced by EdgesBottomUp(), m::pe::hs::expansions::BottomUpComplete::operator()(), and operator==().
|
inline |
Definition at line 778 of file HeuristicSearchPlanEnumerator.hpp.
References end().
Referenced by EdgesBottomUp(), m::pe::hs::expansions::BottomUpComplete::operator()(), and operator==().
|
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 813 of file HeuristicSearchPlanEnumerator.hpp.
References m::SmallBitset::All(), m::SmallBitset::empty(), id, m::QueryGraph::joins(), M_insist, m::QueryGraph::num_sources(), num_subproblems(), m::SmallBitset::Singleton(), and m::Join::sources().
Referenced by for_each_subproblem(), and m::pe::hs::expansions::BottomUpComplete::operator()().
|
inlinestatic |
Definition at line 749 of file HeuristicSearchPlanEnumerator.hpp.
References EdgesBottomUp(), and m::QueryGraph::num_sources().
|
inlineinherited |
Reduces the g value of the state.
Definition at line 160 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 762 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 867 of file HeuristicSearchPlanEnumerator.hpp.
References dump().
Referenced by dump().
|
inline |
Definition at line 866 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 774 of file HeuristicSearchPlanEnumerator.hpp.
References begin(), and num_joins().
Referenced by cend(), EdgesBottomUp(), and for_each_subproblem().
|
inline |
Definition at line 776 of file HeuristicSearchPlanEnumerator.hpp.
References begin(), and num_joins().
|
inline |
Definition at line 781 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 761 of file HeuristicSearchPlanEnumerator.hpp.
References g_.
Referenced by m::pe::hs::expansions::BottomUpComplete::operator()().
|
inlinestatic |
returns a reference to the class-wide allocator
Definition at line 652 of file HeuristicSearchPlanEnumerator.hpp.
References allocator_.
|
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 756 of file HeuristicSearchPlanEnumerator.hpp.
References num_joins(), and num_joins_to_goal_.
|
inlineinherited |
Definition at line 148 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 763 of file HeuristicSearchPlanEnumerator.hpp.
References num_joins_.
Referenced by end(), is_goal(), num_subproblems(), m::pe::hs::expansions::BottomUpComplete::operator()(), operator==(), and operator[]().
|
inline |
Definition at line 768 of file HeuristicSearchPlanEnumerator.hpp.
References num_joins_to_goal_.
Referenced by m::pe::hs::expansions::BottomUpComplete::operator()().
|
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.
|
inline |
Definition at line 764 of file HeuristicSearchPlanEnumerator.hpp.
References M_insist, num_joins(), and m::QueryGraph::num_sources().
Referenced by compute_datasource_to_subproblem_index().
|
inlineinherited |
Definition at line 165 of file HeuristicSearchPlanEnumerator.hpp.
|
inline |
Definition at line 807 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 795 of file HeuristicSearchPlanEnumerator.hpp.
References cbegin(), cend(), M_insist, and num_joins().
Referenced by operator!=().
|
inline |
Definition at line 769 of file HeuristicSearchPlanEnumerator.hpp.
References joins_, M_insist, and num_joins().
|
inlineinherited |
Definition at line 138 of file HeuristicSearchPlanEnumerator.hpp.
|
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 857 of file HeuristicSearchPlanEnumerator.hpp.
|
friend |
Definition at line 666 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by EdgesBottomUp(), and operator=().
|
staticprivate |
class-wide allocator, used by all instances
Definition at line 648 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by get_allocator(), and ~EdgesBottomUp().
|
privateinherited |
|
mutableprivate |
the cost to reach this state from the initial state
Definition at line 658 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by decrease_g(), and g().
|
private |
array of IDs of joins performed
Definition at line 662 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by begin(), EdgesBottomUp(), operator[](), and ~EdgesBottomUp().
|
private |
number of joins performed to reach this state
Definition at line 660 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by EdgesBottomUp(), num_joins(), and ~EdgesBottomUp().
|
private |
number of joins necessary to reach goal
Definition at line 656 of file HeuristicSearchPlanEnumerator.hpp.
Referenced by is_goal(), and num_joins_to_goal().
|
staticprivateinherited |
Definition at line 103 of file HeuristicSearchPlanEnumerator.hpp.