mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
m::PlanTableSmallOrDense Struct Reference

This table represents all explored plans with their sub-plans, estimated size, cost, and further optional properties. More...

#include <PlanTable.hpp>

Inheritance diagram for m::PlanTableSmallOrDense:
[legend]
Collaboration diagram for m::PlanTableSmallOrDense:
[legend]

Public Types

using allocator_type = malloc_allocator
 
using size_type = std::size_t
 
using Subproblem = QueryGraph::Subproblem
 
using cost_type = decltype(PlanTableEntry::cost)
 
using actual_type = ConcreteType
 

Public Member Functions

 PlanTableSmallOrDense ()=default
 
 PlanTableSmallOrDense (size_type num_sources, size_type num_additional_entries=0, allocator_type allocator=allocator_type())
 
 PlanTableSmallOrDense (const QueryGraph &G, allocator_type allocator=allocator_type())
 
 PlanTableSmallOrDense (const PlanTableSmallOrDense &)=delete
 
 PlanTableSmallOrDense (PlanTableSmallOrDense &&other)
 
 ~PlanTableSmallOrDense ()
 
PlanTableSmallOrDenseoperator= (PlanTableSmallOrDense &&other)
 
bool operator== (const PlanTableSmallOrDense &other) const
 
bool operator!= (const PlanTableSmallOrDense &other) const
 
size_type num_sources () const
 
size_type size () const
 
PlanTableEntryat (Subproblem s)
 
const PlanTableEntryat (Subproblem s) const
 
PlanTableEntryoperator[] (Subproblem s)
 
const PlanTableEntryoperator[] (Subproblem s) const
 
bool has_plan (Subproblem s) const
 
void reset_costs ()
 
void dump (std::ostream &out) const
 
void dump () const
 
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.
 
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.
 
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.
 
actual_typeactual ()
 
const actual_typeactual () const
 

Private Member Functions

auto begin ()
 
auto end ()
 

Private Attributes

allocator_type allocator_
 

‍the allocator


 
size_type num_sources_
 

‍the number of DataSources in the query


 
size_type num_additional_entries_
 

‍the number of additional entries this should contain


 
std::unique_ptr< PlanTableEntry[]> table_ = nullptr
 

‍the table of problem plans, sizes, and costs


 
friend CRTPBaseType< actual_type, TParams... >
 

Friends

struct PlanTableDecorator< PlanTableSmallOrDense >
 
void swap (PlanTableSmallOrDense &first, PlanTableSmallOrDense &second)
 
std::ostream &M_EXPORT operator<< (std::ostream &out, const PlanTableSmallOrDense &PT)
 

Detailed Description

This table represents all explored plans with their sub-plans, estimated size, cost, and further optional properties.

The PlanTableSmallOrDense is optimized for "small" queries, i.e. queries of few relations and/or a dense query graph.

Definition at line 179 of file PlanTable.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.

◆ allocator_type

Definition at line 183 of file PlanTable.hpp.

◆ cost_type

using m::PlanTableBase< PlanTableSmallOrDense >::cost_type = decltype(PlanTableEntry::cost)
inherited

Definition at line 75 of file PlanTable.hpp.

◆ size_type

using m::PlanTableBase< PlanTableSmallOrDense >::size_type = std::size_t
inherited

Definition at line 73 of file PlanTable.hpp.

◆ Subproblem

Definition at line 74 of file PlanTable.hpp.

Constructor & Destructor Documentation

◆ PlanTableSmallOrDense() [1/5]

m::PlanTableSmallOrDense::PlanTableSmallOrDense ( )
default

◆ PlanTableSmallOrDense() [2/5]

m::PlanTableSmallOrDense::PlanTableSmallOrDense ( size_type  num_sources,
size_type  num_additional_entries = 0,
allocator_type  allocator = allocator_type() 
)
inlineexplicit

Definition at line 205 of file PlanTable.hpp.

◆ PlanTableSmallOrDense() [3/5]

m::PlanTableSmallOrDense::PlanTableSmallOrDense ( const QueryGraph G,
allocator_type  allocator = allocator_type() 
)
inlineexplicit

Definition at line 217 of file PlanTable.hpp.

◆ PlanTableSmallOrDense() [4/5]

m::PlanTableSmallOrDense::PlanTableSmallOrDense ( const PlanTableSmallOrDense )
delete

◆ PlanTableSmallOrDense() [5/5]

m::PlanTableSmallOrDense::PlanTableSmallOrDense ( PlanTableSmallOrDense &&  other)
inline

Definition at line 222 of file PlanTable.hpp.

References m::swap().

◆ ~PlanTableSmallOrDense()

m::PlanTableSmallOrDense::~PlanTableSmallOrDense ( )
inline

Definition at line 224 of file PlanTable.hpp.

References m::allocator< Actual >::dispose().

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.

◆ at() [1/2]

PlanTableEntry & m::PlanTableSmallOrDense::at ( Subproblem  s)
inline

Definition at line 248 of file PlanTable.hpp.

References M_insist.

◆ at() [2/2]

const PlanTableEntry & m::PlanTableSmallOrDense::at ( Subproblem  s) const
inline

Definition at line 249 of file PlanTable.hpp.

References at().

Referenced by at().

◆ begin()

auto m::PlanTableSmallOrDense::begin ( )
inlineprivate

Definition at line 270 of file PlanTable.hpp.

◆ c()

cost_type m::PlanTableBase< PlanTableSmallOrDense >::c ( Subproblem  s) const
inlineinherited

Returns the cost of the best plan to compute s.

Definition at line 112 of file PlanTable.hpp.

◆ dump() [1/2]

void PlanTableSmallOrDense::dump ( ) const

Definition at line 72 of file PlanTable.cpp.

References dump().

Referenced by dump().

◆ dump() [2/2]

void PlanTableSmallOrDense::dump ( std::ostream &  out) const

Definition at line 71 of file PlanTable.cpp.

◆ end()

auto m::PlanTableSmallOrDense::end ( )
inlineprivate

Definition at line 271 of file PlanTable.hpp.

◆ get_final() [1/2]

PlanTableEntry & m::PlanTableBase< PlanTableSmallOrDense >::get_final ( )
inlineinherited

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

the plan that joins all relations.

Definition at line 107 of file PlanTable.hpp.

◆ get_final() [2/2]

const PlanTableEntry & m::PlanTableBase< PlanTableSmallOrDense >::get_final ( ) const
inlineinherited

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

the plan that joins all relations.

Definition at line 109 of file PlanTable.hpp.

◆ has_plan()

bool m::PlanTableSmallOrDense::has_plan ( Subproblem  s) const
inline

Definition at line 254 of file PlanTable.hpp.

References M_insist, and m::SmallBitset::size().

◆ num_sources()

size_type m::PlanTableSmallOrDense::num_sources ( ) const
inline

Definition at line 245 of file PlanTable.hpp.

Referenced by operator==().

◆ operator!=() [1/2]

bool m::PlanTableBase< PlanTableSmallOrDense >::operator!= ( const PlanTableBase< PlanTableSmallOrDense > &  other) const
inlineinherited

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

Definition at line 91 of file PlanTable.hpp.

◆ operator!=() [2/2]

bool m::PlanTableSmallOrDense::operator!= ( const PlanTableSmallOrDense other) const
inline

Definition at line 243 of file PlanTable.hpp.

◆ operator=()

PlanTableSmallOrDense & m::PlanTableSmallOrDense::operator= ( PlanTableSmallOrDense &&  other)
inline

Definition at line 232 of file PlanTable.hpp.

References m::swap().

◆ operator==() [1/2]

bool m::PlanTableBase< PlanTableSmallOrDense >::operator== ( const PlanTableBase< PlanTableSmallOrDense > &  other) const
inlineinherited

Returns true if two tables contain the exact same entries.

Definition at line 89 of file PlanTable.hpp.

◆ operator==() [2/2]

bool m::PlanTableSmallOrDense::operator== ( const PlanTableSmallOrDense other) const
inline

Definition at line 234 of file PlanTable.hpp.

References num_sources(), and size().

◆ operator[]() [1/2]

PlanTableEntry & m::PlanTableSmallOrDense::operator[] ( Subproblem  s)
inline

Definition at line 251 of file PlanTable.hpp.

◆ operator[]() [2/2]

const PlanTableEntry & m::PlanTableSmallOrDense::operator[] ( Subproblem  s) const
inline

Definition at line 252 of file PlanTable.hpp.

◆ reset_costs()

void m::PlanTableSmallOrDense::reset_costs ( )
inline

Definition at line 261 of file PlanTable.hpp.

References m::SmallBitset::is_singleton().

◆ size()

size_type m::PlanTableSmallOrDense::size ( ) const
inline

Definition at line 246 of file PlanTable.hpp.

Referenced by operator==().

◆ update()

void m::PlanTableBase< PlanTableSmallOrDense >::update ( const QueryGraph G,
const CardinalityEstimator CE,
const CostFunction CF,
Subproblem  left,
Subproblem  right,
const cnf::CNF condition 
)
inlineinherited

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.

Friends And Related Function Documentation

◆ operator<<

std::ostream &M_EXPORT operator<< ( std::ostream &  out,
const PlanTableSmallOrDense PT 
)
friend

◆ PlanTableDecorator< PlanTableSmallOrDense >

Definition at line 173 of file PlanTable.hpp.

◆ swap

void swap ( PlanTableSmallOrDense first,
PlanTableSmallOrDense second 
)
friend

Definition at line 196 of file PlanTable.hpp.

Field Documentation

◆ allocator_

allocator_type m::PlanTableSmallOrDense::allocator_
private

‍the allocator

Definition at line 187 of file PlanTable.hpp.

◆ 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.

◆ num_additional_entries_

size_type m::PlanTableSmallOrDense::num_additional_entries_
private

‍the number of additional entries this should contain

Definition at line 191 of file PlanTable.hpp.

◆ num_sources_

size_type m::PlanTableSmallOrDense::num_sources_
private

‍the number of DataSources in the query

Definition at line 189 of file PlanTable.hpp.

◆ table_

std::unique_ptr<PlanTableEntry[]> m::PlanTableSmallOrDense::table_ = nullptr
private

‍the table of problem plans, sizes, and costs

Definition at line 193 of file PlanTable.hpp.


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