![]() |
mutable
A Database System for Research and Fast Prototyping
|
Concrete PhysicalOptimizer
implementation using a concrete statically-typed.
More...
#include <PhysicalOptimizer.hpp>
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 | |
PhysicalPlanTable & | table () |
const PhysicalPlanTable & | table () 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< MatchBase > | extract_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_ |
| |
Private Member Functions | |
entry_type & | get_plan_entry () |
Returns the entry for the found physical operator covering. | |
const entry_type & | get_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_ |
| |
Friends | |
template<typename , std::size_t , typename... > | |
struct | pattern_matcher_recursive |
Concrete PhysicalOptimizer
implementation using a concrete statically-typed.
PhysicalPlanTable | implementing the PhysicalPlanTable interface. |
Definition at line 286 of file PhysicalOptimizer.hpp.
using m::PhysicalOptimizerImpl< PhysicalPlanTable >::children_type = std::vector<typename PhysicalPlanTable::condition2entry_map_type::const_iterator> |
Definition at line 292 of file PhysicalOptimizer.hpp.
using m::PhysicalOptimizerImpl< PhysicalPlanTable >::cost_type = PhysicalPlanTable::condition2entry_map_type::entry_type::cost_type |
Definition at line 291 of file PhysicalOptimizer.hpp.
using m::PhysicalOptimizerImpl< PhysicalPlanTable >::entry_type = PhysicalPlanTable::condition2entry_map_type::entry_type |
Definition at line 290 of file PhysicalOptimizer.hpp.
|
overridevirtual |
Implements m::PhysicalOptimizer.
Definition at line 22 of file PhysicalOptimizer.cpp.
|
pure virtualinherited |
|
inlineoverridevirtual |
Finds an optimal physical operator covering for the logical plan rooted in plan
.
Implements m::PhysicalOptimizer.
Definition at line 302 of file PhysicalOptimizer.hpp.
References m::Operator::assign_post_order_ids(), m::PhysicalPlanTable< Actual, Condition2EntryMap >::clear(), m::Operator::id(), m::PhysicalPlanTable< Actual, Condition2EntryMap >::resize(), and m::PhysicalOptimizerImpl< PhysicalPlanTable >::table().
Referenced by m::QueryDatabase::execute(), m::execute_statement(), and m::physical_plan_from_logical_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().
|
inlineprivate |
Returns the entry for the found physical operator covering.
Definition at line 312 of file PhysicalOptimizer.hpp.
References m::PhysicalPlanTable< Actual, Condition2EntryMap >::back(), m::PhysicalOptimizerImpl< PhysicalPlanTable >::has_plan(), M_insist, and m::PhysicalOptimizerImpl< PhysicalPlanTable >::table().
Referenced by m::PhysicalOptimizerImpl< PhysicalPlanTable >::extract_plan().
|
inlineprivate |
Definition at line 324 of file PhysicalOptimizer.hpp.
References m::PhysicalOptimizerImpl< PhysicalPlanTable >::get_plan_entry().
Referenced by m::PhysicalOptimizerImpl< PhysicalPlanTable >::get_plan_entry().
|
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().
|
inlineoverridevirtual |
Returns true iff a physical operator covering is found.
Implements m::PhysicalOptimizer.
Definition at line 309 of file PhysicalOptimizer.hpp.
References m::PhysicalPlanTable< Actual, Condition2EntryMap >::back(), and m::PhysicalOptimizerImpl< PhysicalPlanTable >::table().
Referenced by m::PhysicalOptimizerImpl< PhysicalPlanTable >::get_plan_entry().
|
override |
|
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().
|
inline |
Definition at line 299 of file PhysicalOptimizer.hpp.
References m::PhysicalOptimizerImpl< PhysicalPlanTable >::table_.
Referenced by m::PhysicalOptimizerImpl< PhysicalPlanTable >::cover(), m::PhysicalOptimizerImpl< PhysicalPlanTable >::get_plan_entry(), m::PhysicalOptimizerImpl< PhysicalPlanTable >::handle_match(), and m::PhysicalOptimizerImpl< PhysicalPlanTable >::has_plan().
|
inline |
Definition at line 300 of file PhysicalOptimizer.hpp.
References m::PhysicalOptimizerImpl< PhysicalPlanTable >::table_.
|
friend |
Definition at line 288 of file PhysicalOptimizer.hpp.
|
protectedinherited |
all pattern matchers for all registered physical operators
Definition at line 263 of file PhysicalOptimizer.hpp.
Referenced by m::PhysicalOptimizer::register_operator().
|
private |
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().