Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::LimitPushdown Class Reference

Public Member Functions

unique_ptr< LogicalOperator > Optimize (unique_ptr< LogicalOperator > op)
 Optimize PROJECTION + LIMIT to LIMIT + Projection.

Static Public Member Functions

static bool CanOptimize (LogicalOperator &op)
 Whether we can perform the optimization on this operator.

Member Function Documentation

◆ Optimize()

unique_ptr< LogicalOperator > duckdb::LimitPushdown::Optimize ( unique_ptr< LogicalOperator > op)

Optimize PROJECTION + LIMIT to LIMIT + Projection.

315103 {
315104 if (CanOptimize(*op)) {
315105 auto projection = std::move(op->children[0]);
315106 op->children[0] = std::move(projection->children[0]);
315107 projection->SetEstimatedCardinality(op->estimated_cardinality);
315108 projection->children[0] = std::move(op);
315109 swap(projection, op);
315110 }
315111 for (auto &child : op->children) {
315112 child = Optimize(std::move(child));
315113 }
315114 return op;
315115}
unique_ptr< LogicalOperator > Optimize(unique_ptr< LogicalOperator > op)
Optimize PROJECTION + LIMIT to LIMIT + Projection.
Definition duckdb.cpp:315103
static bool CanOptimize(LogicalOperator &op)
Whether we can perform the optimization on this operator.
Definition duckdb.cpp:315082
void swap(Mat &a, Mat &b)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CanOptimize()

bool duckdb::LimitPushdown::CanOptimize ( duckdb::LogicalOperator & op)
static

Whether we can perform the optimization on this operator.

315082 {
315083 if (op.type == LogicalOperatorType::LOGICAL_LIMIT &&
315084 op.children[0]->type == LogicalOperatorType::LOGICAL_PROJECTION) {
315085 auto &limit = op.Cast<LogicalLimit>();
315086
315087 if (limit.offset_val.Type() == LimitNodeType::EXPRESSION_PERCENTAGE ||
315088 limit.offset_val.Type() == LimitNodeType::EXPRESSION_VALUE) {
315089 // Offset cannot be an expression
315090 return false;
315091 }
315092
315093 if (limit.limit_val.Type() == LimitNodeType::CONSTANT_VALUE && limit.limit_val.GetConstantValue() < 8192) {
315094 // Push down only when limit value is smaller than 8192.
315095 // when physical_limit is introduced, it will end a parallel pipeline
315096 // restrict the limit value to be small so that remaining operations run fast without parallelization.
315097 return true;
315098 }
315099 }
315100 return false;
315101}
vector< unique_ptr< LogicalOperator > > children
The set of children of the operator.
Definition duckdb.hpp:21262
LogicalOperatorType type
The type of the logical operator.
Definition duckdb.hpp:21260
Here is the caller graph for this function:

The documentation for this class was generated from the following file: