mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
m::PlanTableLargeAndSparse 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::PlanTableLargeAndSparse:
[legend]
Collaboration diagram for m::PlanTableLargeAndSparse:
[legend]

Public Types

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

Public Member Functions

 PlanTableLargeAndSparse ()=default
 
 PlanTableLargeAndSparse (size_type num_sources, size_type num_additional_entries=0)
 
 PlanTableLargeAndSparse (const QueryGraph &G)
 
 PlanTableLargeAndSparse (const PlanTableLargeAndSparse &)=delete
 
 PlanTableLargeAndSparse (PlanTableLargeAndSparse &&other)
 
PlanTableLargeAndSparseoperator= (PlanTableLargeAndSparse &&other)
 
bool operator== (const PlanTableLargeAndSparse &other) const
 
bool operator!= (const PlanTableLargeAndSparse &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 ()
 

Static Private Member Functions

static size_type OnoLohmannCycle (size_type N)
 Computes the number of connected subgraphs (CSGs) of a query graph with N relations and cycle topology.
 

Private Attributes

size_type num_sources_
 

‍the number of DataSources in the query


 
std::unordered_map< Subproblem, PlanTableEntry, SubproblemHashtable_
 

‍the PlanTableEntrys


 
friend CRTPBaseType< actual_type, TParams... >
 

Friends

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

Detailed Description

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

The PlanTableLargeAndSparse is optimized for "large" queries, i.e. queries of many relations or with a sparse query graph.

Definition at line 283 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.

◆ cost_type

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

Definition at line 75 of file PlanTable.hpp.

◆ size_type

using m::PlanTableBase< PlanTableLargeAndSparse >::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

◆ PlanTableLargeAndSparse() [1/5]

m::PlanTableLargeAndSparse::PlanTableLargeAndSparse ( )
default

◆ PlanTableLargeAndSparse() [2/5]

m::PlanTableLargeAndSparse::PlanTableLargeAndSparse ( size_type  num_sources,
size_type  num_additional_entries = 0 
)
inlineexplicit

Definition at line 301 of file PlanTable.hpp.

◆ PlanTableLargeAndSparse() [3/5]

m::PlanTableLargeAndSparse::PlanTableLargeAndSparse ( const QueryGraph G)
inlineexplicit

Definition at line 305 of file PlanTable.hpp.

◆ PlanTableLargeAndSparse() [4/5]

m::PlanTableLargeAndSparse::PlanTableLargeAndSparse ( const PlanTableLargeAndSparse )
delete

◆ PlanTableLargeAndSparse() [5/5]

m::PlanTableLargeAndSparse::PlanTableLargeAndSparse ( PlanTableLargeAndSparse &&  other)
inline

Definition at line 310 of file PlanTable.hpp.

References m::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.

◆ at() [1/2]

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

Definition at line 331 of file PlanTable.hpp.

◆ at() [2/2]

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

Definition at line 332 of file PlanTable.hpp.

References at().

Referenced by at().

◆ begin()

auto m::PlanTableLargeAndSparse::begin ( )
inlineprivate

Definition at line 358 of file PlanTable.hpp.

◆ c()

cost_type m::PlanTableBase< PlanTableLargeAndSparse >::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 PlanTableLargeAndSparse::dump ( ) const

Definition at line 146 of file PlanTable.cpp.

References dump().

Referenced by dump().

◆ dump() [2/2]

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

Definition at line 145 of file PlanTable.cpp.

◆ end()

auto m::PlanTableLargeAndSparse::end ( )
inlineprivate

Definition at line 359 of file PlanTable.hpp.

◆ get_final() [1/2]

PlanTableEntry & m::PlanTableBase< PlanTableLargeAndSparse >::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< PlanTableLargeAndSparse >::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::PlanTableLargeAndSparse::has_plan ( Subproblem  s) const
inline

Definition at line 339 of file PlanTable.hpp.

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

◆ num_sources()

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

Definition at line 328 of file PlanTable.hpp.

Referenced by operator==().

◆ OnoLohmannCycle()

static size_type m::PlanTableLargeAndSparse::OnoLohmannCycle ( size_type  N)
inlinestaticprivate

Computes the number of connected subgraphs (CSGs) of a query graph with N relations and cycle topology.

Definition at line 369 of file PlanTable.hpp.

◆ operator!=() [1/2]

bool m::PlanTableBase< PlanTableLargeAndSparse >::operator!= ( const PlanTableBase< PlanTableLargeAndSparse > &  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::PlanTableLargeAndSparse::operator!= ( const PlanTableLargeAndSparse other) const
inline

Definition at line 326 of file PlanTable.hpp.

◆ operator=()

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

Definition at line 312 of file PlanTable.hpp.

References m::swap().

◆ operator==() [1/2]

bool m::PlanTableBase< PlanTableLargeAndSparse >::operator== ( const PlanTableBase< PlanTableLargeAndSparse > &  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::PlanTableLargeAndSparse::operator== ( const PlanTableLargeAndSparse other) const
inline

Definition at line 314 of file PlanTable.hpp.

References num_sources(), and table_.

◆ operator[]() [1/2]

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

Definition at line 334 of file PlanTable.hpp.

◆ operator[]() [2/2]

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

Definition at line 335 of file PlanTable.hpp.

◆ reset_costs()

void m::PlanTableLargeAndSparse::reset_costs ( )
inline

Definition at line 350 of file PlanTable.hpp.

◆ size()

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

Definition at line 329 of file PlanTable.hpp.

◆ update()

void m::PlanTableBase< PlanTableLargeAndSparse >::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 PlanTableLargeAndSparse PT 
)
friend

◆ PlanTableDecorator< PlanTableLargeAndSparse >

Definition at line 277 of file PlanTable.hpp.

◆ swap

void swap ( PlanTableLargeAndSparse first,
PlanTableLargeAndSparse second 
)
friend

Definition at line 294 of file PlanTable.hpp.

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.

◆ num_sources_

size_type m::PlanTableLargeAndSparse::num_sources_
private

‍the number of DataSources in the query

Definition at line 289 of file PlanTable.hpp.

◆ table_

std::unordered_map<Subproblem, PlanTableEntry, SubproblemHash> m::PlanTableLargeAndSparse::table_
private

‍the PlanTableEntrys

Definition at line 291 of file PlanTable.hpp.

Referenced by operator==().


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