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

Concrete PhysicalOptimizer implementation using a concrete statically-typed. More...

#include <PhysicalOptimizer.hpp>

Inheritance diagram for m::PhysicalOptimizerImpl< PhysicalPlanTable >:
[legend]
Collaboration diagram for m::PhysicalOptimizerImpl< PhysicalPlanTable >:
[legend]

Public Types

using entry_type = PhysicalPlanTable::condition2entry_map_type::entry_type
 
using cost_type = PhysicalPlanTable::condition2entry_map_type::entry_type::cost_type
 
using children_type = std::vector< typename PhysicalPlanTable::condition2entry_map_type::const_iterator >
 

Public Member Functions

PhysicalPlanTabletable ()
 
const PhysicalPlanTabletable () const
 
void cover (const Operator &plan) override
 Finds an optimal physical operator covering for the logical plan rooted in plan.
 
bool has_plan () const override
 Returns true iff a physical operator covering is found.
 
std::unique_ptr< MatchBaseextract_plan () override
 Extracts the found physical operator covering by moving it out of the underlying physical plan table.
 
 M_OPERATOR_LIST (DECLARE) void accept(PhysOptVisitor &v) override
 
void accept (ConstPhysOptVisitor &v) const override
 
template<typename PhysOp >
void register_operator ()
 Registers a new physical operator which then may be used to find a covering.
 
virtual void accept (PhysOptVisitor &v)=0
 

Protected Attributes

std::vector< std::unique_ptr< const pattern_matcher_base > > pattern_matchers_
 

‍all pattern matchers for all registered physical operators


 

Private Member Functions

entry_typeget_plan_entry ()
 Returns the entry for the found physical operator covering.
 
const entry_typeget_plan_entry () const
 
template<typename PhysOp >
void handle_match (const Operator &op, std::unique_ptr< Match< PhysOp > > &&match, const children_type &children)
 Handles the found match match with children entries children for the logical plan rooted in op.
 

Private Attributes

PhysicalPlanTable table_
 

‍dynamic programming table, stores the best covering for each logical operator per unique post-condition


 

Friends

template<typename , std::size_t , typename... >
struct pattern_matcher_recursive
 

Detailed Description

template<typename PhysicalPlanTable>
struct m::PhysicalOptimizerImpl< PhysicalPlanTable >

Concrete PhysicalOptimizer implementation using a concrete statically-typed.

Template Parameters
PhysicalPlanTableimplementing the PhysicalPlanTable interface.

Definition at line 286 of file PhysicalOptimizer.hpp.

Member Typedef Documentation

◆ children_type

template<typename PhysicalPlanTable >
using m::PhysicalOptimizerImpl< PhysicalPlanTable >::children_type = std::vector<typename PhysicalPlanTable::condition2entry_map_type::const_iterator>

Definition at line 292 of file PhysicalOptimizer.hpp.

◆ cost_type

template<typename PhysicalPlanTable >
using m::PhysicalOptimizerImpl< PhysicalPlanTable >::cost_type = PhysicalPlanTable::condition2entry_map_type::entry_type::cost_type

Definition at line 291 of file PhysicalOptimizer.hpp.

◆ entry_type

template<typename PhysicalPlanTable >
using m::PhysicalOptimizerImpl< PhysicalPlanTable >::entry_type = PhysicalPlanTable::condition2entry_map_type::entry_type

Definition at line 290 of file PhysicalOptimizer.hpp.

Member Function Documentation

◆ accept() [1/2]

template<typename PhysicalPlanTable >
void PhysicalOptimizerImpl::accept ( ConstPhysOptVisitor &  v) const
overridevirtual

Implements m::PhysicalOptimizer.

Definition at line 22 of file PhysicalOptimizer.cpp.

◆ accept() [2/2]

virtual void m::PhysicalOptimizer::accept ( PhysOptVisitor &  v)
pure virtualinherited

◆ cover()

template<typename PhysicalPlanTable >
void m::PhysicalOptimizerImpl< PhysicalPlanTable >::cover ( const Operator plan)
inlineoverridevirtual

◆ extract_plan()

template<typename PhysicalPlanTable >
std::unique_ptr< MatchBase > m::PhysicalOptimizerImpl< PhysicalPlanTable >::extract_plan ( )
inlineoverridevirtual

Extracts the found physical operator covering by moving it out of the underlying physical plan table.

Implements m::PhysicalOptimizer.

Definition at line 326 of file PhysicalOptimizer.hpp.

References m::PhysicalOptimizerImpl< PhysicalPlanTable >::get_plan_entry(), and M_nothrow.

Referenced by m::QueryDatabase::execute(), m::execute_statement(), and m::physical_plan_from_logical_plan().

◆ get_plan_entry() [1/2]

template<typename PhysicalPlanTable >
entry_type & m::PhysicalOptimizerImpl< PhysicalPlanTable >::get_plan_entry ( )
inlineprivate

◆ get_plan_entry() [2/2]

template<typename PhysicalPlanTable >
const entry_type & m::PhysicalOptimizerImpl< PhysicalPlanTable >::get_plan_entry ( ) const
inlineprivate

◆ handle_match()

template<typename PhysicalPlanTable >
template<typename PhysOp >
void m::PhysicalOptimizerImpl< PhysicalPlanTable >::handle_match ( const Operator op,
std::unique_ptr< Match< PhysOp > > &&  match,
const children_type children 
)
inlineprivate

Handles the found match match with children entries children for the logical plan rooted in op.

Definition at line 334 of file PhysicalOptimizer.hpp.

References m::PhysicalOptimizerImpl< PhysicalPlanTable >::table().

◆ has_plan()

template<typename PhysicalPlanTable >
bool m::PhysicalOptimizerImpl< PhysicalPlanTable >::has_plan ( ) const
inlineoverridevirtual

◆ M_OPERATOR_LIST()

template<typename PhysicalPlanTable >
m::PhysicalOptimizerImpl< PhysicalPlanTable >::M_OPERATOR_LIST ( DECLARE  ) &
override

◆ register_operator()

template<typename PhysOp >
void m::PhysicalOptimizer::register_operator
inherited

Registers a new physical operator which then may be used to find a covering.

Definition at line 677 of file PhysicalOptimizer.hpp.

References m::PhysicalOptimizer::pattern_matchers_, and m::visit().

Referenced by m::register_wasm_operators().

◆ table() [1/2]

◆ table() [2/2]

template<typename PhysicalPlanTable >
const PhysicalPlanTable & m::PhysicalOptimizerImpl< PhysicalPlanTable >::table ( ) const
inline

Friends And Related Function Documentation

◆ pattern_matcher_recursive

template<typename PhysicalPlanTable >
template<typename , std::size_t , typename... >
friend struct pattern_matcher_recursive
friend

Definition at line 288 of file PhysicalOptimizer.hpp.

Field Documentation

◆ pattern_matchers_

std::vector<std::unique_ptr<const pattern_matcher_base> > m::PhysicalOptimizer::pattern_matchers_
protectedinherited

‍all pattern matchers for all registered physical operators

Definition at line 263 of file PhysicalOptimizer.hpp.

Referenced by m::PhysicalOptimizer::register_operator().

◆ table_

‍dynamic programming table, stores the best covering for each logical operator per unique post-condition

Definition at line 296 of file PhysicalOptimizer.hpp.

Referenced by m::PhysicalOptimizerImpl< PhysicalPlanTable >::table().


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