![]() |
mutable
A Database System for Research and Fast Prototyping
|
An Operator
represents an operation in a query plan.
More...
#include <Operator.hpp>
Public Member Functions | |
Operator ()=default | |
Operator (Operator &&other) | |
virtual | ~Operator () |
Schema & | schema () |
Returns the Schema of this Operator . | |
const Schema & | schema () const |
Returns the Schema of this Operator . | |
bool | has_info () const |
OperatorInformation & | info () |
const OperatorInformation & | info () const |
std::unique_ptr< OperatorInformation > | info (std::unique_ptr< OperatorInformation > new_info) |
virtual void | assign_post_order_ids (std::size_t start_id=0UL) const |
Assigns IDs to the operator tree rooted in this in post-order starting with ID start_id . | |
virtual void | reset_ids () const |
Resets the IDs of the operator tree rooted in this . | |
std::size_t | id () const |
Returns the ID of this . | |
OperatorData * | data (OperatorData *data) const |
Attached OperatorData data to this Operator . | |
OperatorData * | data () const |
Returns the OperatorData attached to this Operator . | |
virtual void | accept (OperatorVisitor &v)=0 |
virtual void | accept (ConstOperatorVisitor &v) const =0 |
void | minimize_schema () |
Minimizes the Schema of this Operator . | |
void | dot (std::ostream &out) const |
Prints a representation of this Operator and its descendants in the dot language. | |
void | dump (std::ostream &out) const |
void | dump () const |
Protected Attributes | |
std::size_t | id_ = -1UL |
the ID of this Operator ; used as index in the DP table of PhysicalOperator | |
Private Member Functions | |
void | id (std::size_t id) const |
Sets the ID of this . | |
Private Attributes | |
Schema | schema_ |
the schema of this Operator | |
std::unique_ptr< OperatorInformation > | info_ |
additional information about this Operator | |
OperatorData * | data_ = nullptr |
the data object associated to this Operator ; may be nullptr | |
Friends | |
void | swap (Operator &first, Operator &second) |
M_EXPORT std::ostream & | operator<< (std::ostream &out, const Operator &op) |
An Operator
represents an operation in a query plan.
A plan is a tree structure of Operator
s. Operator
s can be evaluated to a sequence of tuples and have a Schema
.
Definition at line 44 of file Operator.hpp.
|
default |
|
inline |
Definition at line 63 of file Operator.hpp.
References m::swap().
|
inlinevirtual |
Definition at line 64 of file Operator.hpp.
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
Assigns IDs to the operator tree rooted in this
in post-order starting with ID start_id
.
Reimplemented in m::Consumer.
Definition at line 81 of file Operator.hpp.
Referenced by m::PhysicalOptimizerImpl< PhysicalPlanTable >::cover().
|
inline |
Returns the OperatorData
attached to this Operator
.
Definition at line 98 of file Operator.hpp.
|
inline |
Attached OperatorData
data
to this Operator
.
Returns the previously attached OperatorData
. May return nullptr
.
Definition at line 96 of file Operator.hpp.
References data().
Referenced by data().
M_LCOV_EXCL_STOP void Operator::dot | ( | std::ostream & | out | ) | const |
Prints a representation of this Operator
and its descendants in the dot language.
Definition at line 100 of file Operator.cpp.
References m::and, m::html_escape(), id(), m::to_string(), and m::visit().
void Operator::dump | ( | ) | const |
M_LCOV_EXCL_START void Operator::dump | ( | std::ostream & | out | ) | const |
Definition at line 220 of file Operator.cpp.
|
inline |
Definition at line 71 of file Operator.hpp.
|
inline |
Returns the ID of this
.
Definition at line 85 of file Operator.hpp.
References M_insist.
Referenced by m::PhysicalOptimizerImpl< PhysicalPlanTable >::cover(), dot(), m::GroupingOperator::GroupingOperator(), and m::ProjectionOperator::ProjectionOperator().
|
inlineprivate |
Sets the ID of this
.
Definition at line 91 of file Operator.hpp.
References id().
Referenced by id().
|
inline |
Definition at line 72 of file Operator.hpp.
References M_insist.
Referenced by m::Optimizer::optimize_source_plans().
|
inline |
|
inline |
Definition at line 74 of file Operator.hpp.
References m::swap().
void Operator::minimize_schema | ( | ) |
Minimizes the Schema
of this Operator
.
The Schema
is reduced to the attributes actually required by ancestors of this Operator
in the plan.
Definition at line 562 of file Operator.cpp.
Referenced by __attribute__().
|
inlinevirtual |
Resets the IDs of the operator tree rooted in this
.
Reimplemented in m::Consumer.
Definition at line 83 of file Operator.hpp.
|
inline |
Returns the Schema
of this Operator
.
Definition at line 67 of file Operator.hpp.
Referenced by m::Consumer::add_child(), m::ProjectionOperator::add_child(), m::GroupingOperator::add_child(), m::AggregationOperator::AggregationOperator(), m::Match< wasm::Scan< SIMDfied > >::execute(), m::Match< wasm::IndexScan< IndexMethod > >::execute(), m::Match< wasm::Filter< Predicated > >::execute(), m::Match< wasm::LazyDisjunctiveFilter >::execute(), m::Match< wasm::Projection >::execute(), m::Match< wasm::NestedLoopsJoin< Predicated > >::execute(), m::Match< wasm::SimpleHashJoin< UniqueBuild, Predicated > >::execute(), m::Match< wasm::HashBasedGroupJoin >::execute(), m::GroupingOperator::GroupingOperator(), m::ProjectionOperator::ProjectionOperator(), m::ProjectionOperator::set_child(), and m::GroupingOperator::set_child().
|
inline |
Returns the Schema
of this Operator
.
Definition at line 69 of file Operator.hpp.
|
friend |
Definition at line 46 of file Operator.hpp.
|
mutableprivate |
the data object associated to this Operator
; may be nullptr
Definition at line 57 of file Operator.hpp.
|
mutableprotected |
the ID of this Operator
; used as index in the DP table of PhysicalOperator
Definition at line 59 of file Operator.hpp.
|
private |
additional information about this Operator
Definition at line 56 of file Operator.hpp.
|
private |
the schema of this Operator
Definition at line 55 of file Operator.hpp.