mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | Friends
m::pe::hs::search_states::EdgePtrBottomUp Struct Reference

#include <HeuristicSearchPlanEnumerator.hpp>

Inheritance diagram for m::pe::hs::search_states::EdgePtrBottomUp:
[legend]
Collaboration diagram for m::pe::hs::search_states::EdgePtrBottomUp:
[legend]

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.
 
EdgePtrBottomUpoperator= (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 EdgePtrBottomUpparent () 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 Subproblems produced by the Joins 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 Subproblems.
 
actual_typeactual ()
 
const actual_typeactual () 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 EdgePtrBottomUpparent_ = 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)
 

Detailed Description

Definition at line 872 of file HeuristicSearchPlanEnumerator.hpp.

Member Typedef Documentation

◆ actual_type

template<typename ConcreteType , template< typename... > typename CRTPBaseType, typename... TParams>
using m::crtp< ConcreteType, CRTPBaseType, TParams >::actual_type = ConcreteType
inherited

Definition at line 51 of file crtp.hpp.

◆ base_type

Definition at line 874 of file HeuristicSearchPlanEnumerator.hpp.

◆ const_iterator

Definition at line 913 of file HeuristicSearchPlanEnumerator.hpp.

◆ iterator

Definition at line 912 of file HeuristicSearchPlanEnumerator.hpp.

◆ size_type

Definition at line 875 of file HeuristicSearchPlanEnumerator.hpp.

Constructor & Destructor Documentation

◆ EdgePtrBottomUp() [1/4]

m::pe::hs::search_states::EdgePtrBottomUp::EdgePtrBottomUp ( const QueryGraph )
inline

◆ EdgePtrBottomUp() [2/4]

m::pe::hs::search_states::EdgePtrBottomUp::EdgePtrBottomUp ( const EdgePtrBottomUp parent,
unsigned  num_joins,
double  g,
unsigned  join_id 
)
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().

◆ ~EdgePtrBottomUp()

m::pe::hs::search_states::EdgePtrBottomUp::~EdgePtrBottomUp ( )
inline

◆ EdgePtrBottomUp() [3/4]

m::pe::hs::search_states::EdgePtrBottomUp::EdgePtrBottomUp ( const EdgePtrBottomUp )
delete

Copy c'tor.

◆ EdgePtrBottomUp() [4/4]

m::pe::hs::search_states::EdgePtrBottomUp::EdgePtrBottomUp ( EdgePtrBottomUp &&  other)
inline

Move c'tor.

Definition at line 1003 of file HeuristicSearchPlanEnumerator.hpp.

References swap.

Member Function Documentation

◆ actual() [1/2]

template<typename ConcreteType , template< typename... > typename CRTPBaseType, typename... TParams>
actual_type & m::crtp< ConcreteType, CRTPBaseType, TParams >::actual ( )
inlineinherited

◆ actual() [2/2]

template<typename ConcreteType , template< typename... > typename CRTPBaseType, typename... TParams>
const actual_type & m::crtp< ConcreteType, CRTPBaseType, TParams >::actual ( ) const
inlineinherited

Definition at line 53 of file crtp.hpp.

◆ begin() [1/2]

iterator m::pe::hs::search_states::EdgePtrBottomUp::begin ( )
inline

Definition at line 1033 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by cbegin().

◆ begin() [2/2]

const_iterator m::pe::hs::search_states::EdgePtrBottomUp::begin ( ) const
inline

Definition at line 1035 of file HeuristicSearchPlanEnumerator.hpp.

◆ cbegin()

const_iterator m::pe::hs::search_states::EdgePtrBottomUp::cbegin ( ) const
inline

◆ cend()

const_iterator m::pe::hs::search_states::EdgePtrBottomUp::cend ( ) const
inline

Definition at line 1038 of file HeuristicSearchPlanEnumerator.hpp.

References end().

◆ compute_datasource_to_subproblem_index()

void m::pe::hs::search_states::EdgePtrBottomUp::compute_datasource_to_subproblem_index ( const QueryGraph G,
Subproblem subproblems,
uint8_t *  datasource_to_subproblem 
) const
inline

Computes the Subproblems produced by the Joins 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()().

◆ CreateInitial()

static EdgePtrBottomUp m::pe::hs::search_states::EdgePtrBottomUp::CreateInitial ( const QueryGraph G,
const AdjacencyMatrix  
)
inlinestatic

◆ decrease_g() [1/2]

double m::pe::hs::search_states::Base< EdgePtrBottomUp >::decrease_g ( const EdgePtrBottomUp new_parent,
double  new_g 
) const
inlineinherited

Reduces the g value of the state.

Definition at line 160 of file HeuristicSearchPlanEnumerator.hpp.

◆ decrease_g() [2/2]

void m::pe::hs::search_states::EdgePtrBottomUp::decrease_g ( double  new_g) const
inline

Definition at line 1025 of file HeuristicSearchPlanEnumerator.hpp.

References g_, and M_insist.

◆ dump() [1/2]

void m::pe::hs::search_states::EdgePtrBottomUp::dump ( ) const
inline

Definition at line 1134 of file HeuristicSearchPlanEnumerator.hpp.

References dump().

Referenced by dump().

◆ dump() [2/2]

void m::pe::hs::search_states::EdgePtrBottomUp::dump ( std::ostream &  out) const
inline

Definition at line 1133 of file HeuristicSearchPlanEnumerator.hpp.

◆ end() [1/2]

iterator m::pe::hs::search_states::EdgePtrBottomUp::end ( )
inline

Definition at line 1034 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by cend(), for_each_subproblem(), and operator==().

◆ end() [2/2]

const_iterator m::pe::hs::search_states::EdgePtrBottomUp::end ( ) const
inline

Definition at line 1036 of file HeuristicSearchPlanEnumerator.hpp.

◆ for_each_subproblem()

template<typename Callback >
void m::pe::hs::search_states::EdgePtrBottomUp::for_each_subproblem ( Callback &&  callback,
const QueryGraph G 
) const
inline

◆ for_each_successor()

void m::pe::hs::search_states::Base< EdgePtrBottomUp >::for_each_successor ( Callback &&  callback,
PlanTable &  PT,
const QueryGraph G,
const AdjacencyMatrix M,
const CostFunction CF,
const CardinalityEstimator CE 
) const
inlineinherited

Returns true iff this and other have the exact same Subproblems.

Calls callback on every state reachable from this state by a single actions.

Definition at line 171 of file HeuristicSearchPlanEnumerator.hpp.

◆ g()

double m::pe::hs::search_states::EdgePtrBottomUp::g ( ) const
inline

◆ INCREMENT_NUM_STATES_CONSTRUCTED()

static void m::pe::hs::search_states::Base< EdgePtrBottomUp >::INCREMENT_NUM_STATES_CONSTRUCTED ( )
inlinestaticinherited

Definition at line 114 of file HeuristicSearchPlanEnumerator.hpp.

◆ INCREMENT_NUM_STATES_DISPOSED()

static void m::pe::hs::search_states::Base< EdgePtrBottomUp >::INCREMENT_NUM_STATES_DISPOSED ( )
inlinestaticinherited

Definition at line 115 of file HeuristicSearchPlanEnumerator.hpp.

◆ INCREMENT_NUM_STATES_EXPANDED()

static void m::pe::hs::search_states::Base< EdgePtrBottomUp >::INCREMENT_NUM_STATES_EXPANDED ( )
inlinestaticinherited

Definition at line 113 of file HeuristicSearchPlanEnumerator.hpp.

◆ INCREMENT_NUM_STATES_GENERATED()

static void m::pe::hs::search_states::Base< EdgePtrBottomUp >::INCREMENT_NUM_STATES_GENERATED ( )
inlinestaticinherited

Definition at line 112 of file HeuristicSearchPlanEnumerator.hpp.

◆ is_bottom()

bool m::pe::hs::search_states::Base< EdgePtrBottomUp >::is_bottom ( const PlanTable &  PT,
const QueryGraph G,
const AdjacencyMatrix M,
const CostFunction CF,
const CardinalityEstimator CE 
) const
inlineinherited

Definition at line 141 of file HeuristicSearchPlanEnumerator.hpp.

◆ is_goal()

template<typename PlanTable >
bool m::pe::hs::search_states::EdgePtrBottomUp::is_goal ( const PlanTable &  ,
const QueryGraph G,
const AdjacencyMatrix ,
const CostFunction ,
const CardinalityEstimator  
) const
inline

◆ is_top()

bool m::pe::hs::search_states::Base< EdgePtrBottomUp >::is_top ( const PlanTable &  PT,
const QueryGraph G,
const AdjacencyMatrix M,
const CostFunction CF,
const CardinalityEstimator CE 
) const
inlineinherited

Definition at line 148 of file HeuristicSearchPlanEnumerator.hpp.

◆ join_id()

unsigned m::pe::hs::search_states::EdgePtrBottomUp::join_id ( ) const
inline

Definition at line 1027 of file HeuristicSearchPlanEnumerator.hpp.

References join_id_, M_notnull, and parent_.

Referenced by compute_datasource_to_subproblem_index().

◆ num_joins()

unsigned m::pe::hs::search_states::EdgePtrBottomUp::num_joins ( ) const
inline

◆ num_joins_remaining()

unsigned m::pe::hs::search_states::EdgePtrBottomUp::num_joins_remaining ( const QueryGraph G) const
inline

◆ NUM_STATES_CONSTRUCTED()

static unsigned m::pe::hs::search_states::Base< EdgePtrBottomUp >::NUM_STATES_CONSTRUCTED ( )
inlinestaticinherited

Definition at line 109 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_DISPOSED()

static unsigned m::pe::hs::search_states::Base< EdgePtrBottomUp >::NUM_STATES_DISPOSED ( )
inlinestaticinherited

Definition at line 110 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_EXPANDED()

static unsigned m::pe::hs::search_states::Base< EdgePtrBottomUp >::NUM_STATES_EXPANDED ( )
inlinestaticinherited

Definition at line 108 of file HeuristicSearchPlanEnumerator.hpp.

◆ NUM_STATES_GENERATED()

static unsigned m::pe::hs::search_states::Base< EdgePtrBottomUp >::NUM_STATES_GENERATED ( )
inlinestaticinherited

Definition at line 107 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator!=() [1/2]

bool m::pe::hs::search_states::Base< EdgePtrBottomUp >::operator!= ( const Base< EdgePtrBottomUp > &  other) const
inlineinherited

Definition at line 165 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator!=() [2/2]

bool m::pe::hs::search_states::EdgePtrBottomUp::operator!= ( const EdgePtrBottomUp other) const
inline

Definition at line 1075 of file HeuristicSearchPlanEnumerator.hpp.

References operator==().

◆ operator<()

bool m::pe::hs::search_states::Base< EdgePtrBottomUp >::operator< ( const Base< EdgePtrBottomUp > &  other) const
inlineinherited

Definition at line 166 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator=()

EdgePtrBottomUp & m::pe::hs::search_states::EdgePtrBottomUp::operator= ( EdgePtrBottomUp  other)
inline

Assignment.

Definition at line 1005 of file HeuristicSearchPlanEnumerator.hpp.

References swap.

◆ operator==() [1/2]

bool m::pe::hs::search_states::Base< EdgePtrBottomUp >::operator== ( const Base< EdgePtrBottomUp > &  other) const
inlineinherited

Definition at line 164 of file HeuristicSearchPlanEnumerator.hpp.

◆ operator==() [2/2]

bool m::pe::hs::search_states::EdgePtrBottomUp::operator== ( const EdgePtrBottomUp other) const
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!=().

◆ parent()

const EdgePtrBottomUp * m::pe::hs::search_states::EdgePtrBottomUp::parent ( ) const
inline

Definition at line 1026 of file HeuristicSearchPlanEnumerator.hpp.

References parent_.

Referenced by compute_datasource_to_subproblem_index().

◆ RESET_STATE_COUNTERS()

static void m::pe::hs::search_states::Base< EdgePtrBottomUp >::RESET_STATE_COUNTERS ( )
inlinestaticinherited

Definition at line 106 of file HeuristicSearchPlanEnumerator.hpp.

◆ STATE_COUNTERS() [1/2]

static state_counters_t m::pe::hs::search_states::Base< EdgePtrBottomUp >::STATE_COUNTERS ( )
inlinestaticinherited

Definition at line 117 of file HeuristicSearchPlanEnumerator.hpp.

◆ STATE_COUNTERS() [2/2]

static state_counters_t m::pe::hs::search_states::Base< EdgePtrBottomUp >::STATE_COUNTERS ( state_counters_t  new_counters)
inlinestaticinherited

Definition at line 118 of file HeuristicSearchPlanEnumerator.hpp.

Friends And Related Function Documentation

◆ operator<<

M_LCOV_EXCL_START friend std::ostream & operator<< ( std::ostream &  out,
const EdgePtrBottomUp S 
)
friend

Definition at line 1124 of file HeuristicSearchPlanEnumerator.hpp.

◆ swap

void swap ( EdgePtrBottomUp first,
EdgePtrBottomUp second 
)
friend

Definition at line 969 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by EdgePtrBottomUp(), and operator=().

Field Documentation

◆ CRTPBaseType< actual_type, TParams... >

template<typename ConcreteType , template< typename... > typename CRTPBaseType, typename... TParams>
friend m::crtp< ConcreteType, CRTPBaseType, TParams >::CRTPBaseType< actual_type, TParams... >
privateinherited

Definition at line 57 of file crtp.hpp.

◆ g_

double m::pe::hs::search_states::EdgePtrBottomUp::g_
mutableprivate

Definition at line 962 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by decrease_g(), and g().

◆ join_id_

unsigned m::pe::hs::search_states::EdgePtrBottomUp::join_id_
private

Definition at line 964 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by join_id().

◆ num_joins_

unsigned m::pe::hs::search_states::EdgePtrBottomUp::num_joins_
private

Definition at line 965 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by num_joins().

◆ parent_

const EdgePtrBottomUp* m::pe::hs::search_states::EdgePtrBottomUp::parent_ = nullptr
private

Definition at line 963 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by join_id(), parent(), and ~EdgePtrBottomUp().

◆ scratchpad_

EdgePtrBottomUp::Scratchpad m::pe::hs::search_states::EdgePtrBottomUp::scratchpad_
staticprivate

Definition at line 959 of file HeuristicSearchPlanEnumerator.hpp.

Referenced by CreateInitial().

◆ state_counters_

Base< EdgePtrBottomUp >::state_counters_t m::pe::hs::search_states::Base< EdgePtrBottomUp >::state_counters_
staticprivateinherited

Definition at line 103 of file HeuristicSearchPlanEnumerator.hpp.


The documentation for this struct was generated from the following files: