OmniSciDB
1dac507f6e
|
A container for relational algebra descriptors defining the execution order for a relational algebra query. Holds the relational algebra descriptors for executing a relational algebra query. Each descriptor holds both a top-level relational algebra node and a ResultSet ptr holding the results from the execution of the accompany node(s). The sequence can be generated on initialization or lazily with calls to the next() operator. More...
#include <RelAlgExecutionDescriptor.h>
Public Member Functions | |
RaExecutionSequence (const RelAlgNode *, const bool build_sequence=true) | |
RaExecutionSequence (std::unique_ptr< RaExecutionDesc > exec_desc) | |
RaExecutionDesc * | next () |
ssize_t | nextStepId (const bool after_reduction) const |
bool | executionFinished () const |
RaExecutionDesc * | getDescriptor (size_t idx) const |
size_t | size () const |
bool | empty () const |
size_t | totalDescriptorsCount () const |
Private Member Functions | |
size_t | stepsToNextReduction () const |
Private Attributes | |
DAG | graph_ |
std::unordered_set< Vertex > | joins_ |
std::vector< Vertex > | ordering_ |
size_t | current_vertex_ = 0 |
size_t | scan_count_ = 0 |
std::vector< std::unique_ptr < RaExecutionDesc > > | descs_ |
A container for relational algebra descriptors defining the execution order for a relational algebra query. Holds the relational algebra descriptors for executing a relational algebra query. Each descriptor holds both a top-level relational algebra node and a ResultSet ptr holding the results from the execution of the accompany node(s). The sequence can be generated on initialization or lazily with calls to the next() operator.
Definition at line 106 of file RelAlgExecutionDescriptor.h.
RaExecutionSequence::RaExecutionSequence | ( | const RelAlgNode * | sink, |
const bool | build_sequence = true |
||
) |
Definition at line 183 of file RelAlgExecutionDescriptor.cpp.
References anonymous_namespace{RelAlgExecutionDescriptor.cpp}::build_dag(), CHECK(), anonymous_namespace{RelAlgExecutionDescriptor.cpp}::get_join_vertices(), graph_, joins_, anonymous_namespace{RelAlgExecutionDescriptor.cpp}::merge_sort_with_input(), next(), and ordering_.
RaExecutionSequence::RaExecutionSequence | ( | std::unique_ptr< RaExecutionDesc > | exec_desc | ) |
Definition at line 205 of file RelAlgExecutionDescriptor.cpp.
References descs_.
|
inline |
Definition at line 132 of file RelAlgExecutionDescriptor.h.
References descs_.
Referenced by RelAlgExecutor::executeRelAlgSeq().
bool RaExecutionSequence::executionFinished | ( | ) | const |
Definition at line 239 of file RelAlgExecutionDescriptor.cpp.
References current_vertex_, nextStepId(), ordering_, and totalDescriptorsCount().
|
inline |
Definition at line 126 of file RelAlgExecutionDescriptor.h.
References CHECK_LT, and descs_.
Referenced by RelAlgExecutor::executeRelAlgQuerySingleStep(), RelAlgExecutor::executeRelAlgSeq(), RelAlgExecutor::executeRelAlgStep(), and RelAlgExecutor::executeRelAlgSubSeq().
RaExecutionDesc * RaExecutionSequence::next | ( | ) |
Return the next execution descriptor in the sequence. If no more execution descriptors exist, returns nullptr.
Definition at line 209 of file RelAlgExecutionDescriptor.cpp.
References CHECK(), current_vertex_, descs_, graph_, joins_, ordering_, and scan_count_.
Referenced by RaExecutionSequence().
ssize_t RaExecutionSequence::nextStepId | ( | const bool | after_reduction | ) | const |
Returns the index of the next execution descriptor in the graph. If after_reduction is true, returns the index of the first execution descriptor after the next global reduction. Returns -1 if no execution descriptors remain in the graph.
Definition at line 227 of file RelAlgExecutionDescriptor.cpp.
References current_vertex_, descs_, ordering_, and stepsToNextReduction().
Referenced by executionFinished().
|
inline |
Definition at line 131 of file RelAlgExecutionDescriptor.h.
References descs_.
Referenced by RelAlgExecutor::executeRelAlgQueryWithFilterPushDown(), and RelAlgExecutor::executeRelAlgSeq().
|
private |
Starting from the current vertex, iterate the graph counting the number of execution descriptors remaining before the next required reduction step. The current vertex is counted as the first step before a reduction is required; i.e. a return value of 0 indicates no additional steps in the graph can be executed without a global reduction, and a return value of 2 indicates the current vertex and both subsequent vertices can be executed before a global reduction is needed.
Definition at line 273 of file RelAlgExecutionDescriptor.cpp.
References CHECK(), CHECK_EQ, current_vertex_, graph_, joins_, and ordering_.
Referenced by nextStepId().
size_t RaExecutionSequence::totalDescriptorsCount | ( | ) | const |
Definition at line 255 of file RelAlgExecutionDescriptor.cpp.
References CHECK(), graph_, joins_, and ordering_.
Referenced by executionFinished().
|
private |
Definition at line 141 of file RelAlgExecutionDescriptor.h.
Referenced by executionFinished(), next(), nextStepId(), and stepsToNextReduction().
|
private |
Definition at line 157 of file RelAlgExecutionDescriptor.h.
Referenced by empty(), getDescriptor(), next(), nextStepId(), RaExecutionSequence(), and size().
|
private |
Definition at line 137 of file RelAlgExecutionDescriptor.h.
Referenced by next(), RaExecutionSequence(), stepsToNextReduction(), and totalDescriptorsCount().
|
private |
Definition at line 139 of file RelAlgExecutionDescriptor.h.
Referenced by next(), RaExecutionSequence(), stepsToNextReduction(), and totalDescriptorsCount().
|
private |
Definition at line 140 of file RelAlgExecutionDescriptor.h.
Referenced by executionFinished(), next(), nextStepId(), RaExecutionSequence(), stepsToNextReduction(), and totalDescriptorsCount().
|
private |
Definition at line 142 of file RelAlgExecutionDescriptor.h.
Referenced by next().