mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends
m::PlanTableBase< Actual > Struct Template Reference

#include <PlanTable.hpp>

Inheritance diagram for m::PlanTableBase< Actual >:
[legend]
Collaboration diagram for m::PlanTableBase< Actual >:
[legend]

Public Types

using size_type = std::size_t
 
using Subproblem = QueryGraph::Subproblem
 
using cost_type = decltype(PlanTableEntry::cost)
 
using actual_type = Actual
 

Public Member Functions

 PlanTableBase (const PlanTableBase &)=delete
 
 PlanTableBase (PlanTableBase &&other)
 
PlanTableBaseoperator= (PlanTableBase other)
 
bool operator== (const PlanTableBase &other) const
 Returns true if two tables contain the exact same entries.
 
bool operator!= (const PlanTableBase &other) const
 Returns true if two tables differ in at least one entry.
 
size_type num_sources () const
 Returns the number of data sources.
 
PlanTableEntryat (Subproblem s)
 Returns a reference to the entry of s.
 
const PlanTableEntryat (Subproblem s) const
 Returns a reference to the entry of s.
 
PlanTableEntryoperator[] (Subproblem s)
 Returns a reference to the entry of s.
 
const PlanTableEntryoperator[] (Subproblem s) const
 Returns a reference to the entry of s.
 
PlanTableEntryget_final ()
 Returns the entry for the final plan, i.e.
 
const PlanTableEntryget_final () const
 Returns the entry for the final plan, i.e.
 
cost_type c (Subproblem s) const
 Returns the cost of the best plan to compute s.
 
bool has_plan (Subproblem s) const
 Returns true iff the plan table has a plan for s.
 
void update (const QueryGraph &G, const CardinalityEstimator &CE, const CostFunction &CF, Subproblem left, Subproblem right, const cnf::CNF &condition)
 Update the entry for left joined with right (left|right) by considering plan left join right.
 
void reset_costs ()
 Resets the costs for all entries in the table.
 
void dump (std::ostream &out) const
 
void dump () const
 
actual_typeactual ()
 
const actual_typeactual () const
 

Protected Member Functions

 PlanTableBase ()=default
 

Private Attributes

friend CRTPBaseType< actual_type, TParams... >
 

Friends

void swap (PlanTableBase &first, PlanTableBase &second)
 
std::ostream &M_EXPORT operator<< (std::ostream &out, const PlanTableBase &PT)
 
std::string to_string (const PlanTableBase &PT)
 

Detailed Description

template<typename Actual>
struct m::PlanTableBase< Actual >

Definition at line 70 of file PlanTable.hpp.

Member Typedef Documentation

◆ actual_type

using m::crtp< Actual , PlanTableBase , TParams >::actual_type = Actual
inherited

Definition at line 51 of file crtp.hpp.

◆ cost_type

template<typename Actual >
using m::PlanTableBase< Actual >::cost_type = decltype(PlanTableEntry::cost)

Definition at line 75 of file PlanTable.hpp.

◆ size_type

template<typename Actual >
using m::PlanTableBase< Actual >::size_type = std::size_t

Definition at line 73 of file PlanTable.hpp.

◆ Subproblem

template<typename Actual >
using m::PlanTableBase< Actual >::Subproblem = QueryGraph::Subproblem

Definition at line 74 of file PlanTable.hpp.

Constructor & Destructor Documentation

◆ PlanTableBase() [1/3]

template<typename Actual >
m::PlanTableBase< Actual >::PlanTableBase ( )
protecteddefault

◆ PlanTableBase() [2/3]

template<typename Actual >
m::PlanTableBase< Actual >::PlanTableBase ( const PlanTableBase< Actual > &  )
delete

◆ PlanTableBase() [3/3]

template<typename Actual >
m::PlanTableBase< Actual >::PlanTableBase ( PlanTableBase< Actual > &&  other)
inline

Definition at line 84 of file PlanTable.hpp.

References m::swap().

Member Function Documentation

◆ actual() [1/2]

actual_type & m::crtp< Actual , PlanTableBase , TParams >::actual ( )
inlineinherited

Definition at line 52 of file crtp.hpp.

◆ actual() [2/2]

const actual_type & m::crtp< Actual , PlanTableBase , TParams >::actual ( ) const
inlineinherited

Definition at line 53 of file crtp.hpp.

◆ at() [1/2]

template<typename Actual >
PlanTableEntry & m::PlanTableBase< Actual >::at ( Subproblem  s)
inline

Returns a reference to the entry of s.

Definition at line 97 of file PlanTable.hpp.

◆ at() [2/2]

template<typename Actual >
const PlanTableEntry & m::PlanTableBase< Actual >::at ( Subproblem  s) const
inline

Returns a reference to the entry of s.

Definition at line 99 of file PlanTable.hpp.

◆ c()

template<typename Actual >
cost_type m::PlanTableBase< Actual >::c ( Subproblem  s) const
inline

Returns the cost of the best plan to compute s.

Definition at line 112 of file PlanTable.hpp.

◆ dump() [1/2]

template<typename Actual >
void m::PlanTableBase< Actual >::dump ( ) const
inline

Definition at line 172 of file PlanTable.hpp.

◆ dump() [2/2]

template<typename Actual >
void m::PlanTableBase< Actual >::dump ( std::ostream &  out) const
inline

Definition at line 171 of file PlanTable.hpp.

◆ get_final() [1/2]

template<typename Actual >
PlanTableEntry & m::PlanTableBase< Actual >::get_final ( )
inline

Returns the entry for the final plan, i.e.

the plan that joins all relations.

Definition at line 107 of file PlanTable.hpp.

References m::SmallBitset::All().

◆ get_final() [2/2]

template<typename Actual >
const PlanTableEntry & m::PlanTableBase< Actual >::get_final ( ) const
inline

Returns the entry for the final plan, i.e.

the plan that joins all relations.

Definition at line 109 of file PlanTable.hpp.

References m::SmallBitset::All().

◆ has_plan()

template<typename Actual >
bool m::PlanTableBase< Actual >::has_plan ( Subproblem  s) const
inline

Returns true iff the plan table has a plan for s.

Definition at line 115 of file PlanTable.hpp.

◆ num_sources()

template<typename Actual >
size_type m::PlanTableBase< Actual >::num_sources ( ) const
inline

Returns the number of data sources.

Definition at line 94 of file PlanTable.hpp.

◆ operator!=()

template<typename Actual >
bool m::PlanTableBase< Actual >::operator!= ( const PlanTableBase< Actual > &  other) const
inline

Returns true if two tables differ in at least one entry.

Definition at line 91 of file PlanTable.hpp.

◆ operator=()

template<typename Actual >
PlanTableBase & m::PlanTableBase< Actual >::operator= ( PlanTableBase< Actual >  other)
inline

Definition at line 86 of file PlanTable.hpp.

References m::swap().

◆ operator==()

template<typename Actual >
bool m::PlanTableBase< Actual >::operator== ( const PlanTableBase< Actual > &  other) const
inline

Returns true if two tables contain the exact same entries.

Definition at line 89 of file PlanTable.hpp.

References m::crtp< ConcreteType, CRTPBaseType, TParams >::actual().

◆ operator[]() [1/2]

template<typename Actual >
PlanTableEntry & m::PlanTableBase< Actual >::operator[] ( Subproblem  s)
inline

Returns a reference to the entry of s.

Definition at line 102 of file PlanTable.hpp.

◆ operator[]() [2/2]

template<typename Actual >
const PlanTableEntry & m::PlanTableBase< Actual >::operator[] ( Subproblem  s) const
inline

Returns a reference to the entry of s.

Definition at line 104 of file PlanTable.hpp.

◆ reset_costs()

template<typename Actual >
void m::PlanTableBase< Actual >::reset_costs ( )
inline

Resets the costs for all entries in the table.

Definition at line 159 of file PlanTable.hpp.

◆ update()

template<typename Actual >
void m::PlanTableBase< Actual >::update ( const QueryGraph G,
const CardinalityEstimator CE,
const CostFunction CF,
Subproblem  left,
Subproblem  right,
const cnf::CNF condition 
)
inline

Update the entry for left joined with right (left|right) by considering plan left join right.

The entry's plan and cost is changed only if the plan's cost is less than the cost of the currently best plan.

Definition at line 119 of file PlanTable.hpp.

References m::CostFunction::calculate_join_cost(), m::SmallBitset::empty(), m::CardinalityEstimator::estimate_join(), M_insist, and m::swap().

Friends And Related Function Documentation

◆ operator<<

template<typename Actual >
std::ostream &M_EXPORT operator<< ( std::ostream &  out,
const PlanTableBase< Actual > &  PT 
)
friend

Definition at line 401 of file PlanTable.hpp.

◆ swap

template<typename Actual >
void swap ( PlanTableBase< Actual > &  first,
PlanTableBase< Actual > &  second 
)
friend

Definition at line 394 of file PlanTable.hpp.

◆ to_string

template<typename Actual >
std::string to_string ( const PlanTableBase< Actual > &  PT)
friend

Definition at line 165 of file PlanTable.hpp.

Field Documentation

◆ CRTPBaseType< actual_type, TParams... >

friend m::crtp< Actual , PlanTableBase , TParams >::PlanTableBase < actual_type, TParams... >
privateinherited

Definition at line 57 of file crtp.hpp.


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