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::StatisticsPropagator Class Reference
Collaboration diagram for duckdb::StatisticsPropagator:

Public Member Functions

 StatisticsPropagator (Optimizer &optimizer, LogicalOperator &root)
 
unique_ptr< NodeStatisticsPropagateStatistics (unique_ptr< LogicalOperator > &node_ptr)
 
column_binding_map_t< unique_ptr< BaseStatistics > > GetStatisticsMap ()
 

Static Public Member Functions

static bool CanPropagateCast (const LogicalType &source, const LogicalType &target)
 Whether or not we can propagate a cast between two types.
 
static unique_ptr< BaseStatisticsTryPropagateCast (const BaseStatistics &stats, const LogicalType &source, const LogicalType &target)
 

Private Member Functions

unique_ptr< NodeStatisticsPropagateStatistics (LogicalOperator &node, unique_ptr< LogicalOperator > &node_ptr)
 Propagate statistics through an operator.
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalFilter &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalGet &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalJoin &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalPositionalJoin &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalProjection &op, unique_ptr< LogicalOperator > &node_ptr)
 
void PropagateStatistics (LogicalComparisonJoin &op, unique_ptr< LogicalOperator > &node_ptr)
 
void PropagateStatistics (LogicalAnyJoin &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalSetOperation &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalAggregate &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalCrossProduct &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalLimit &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalOrder &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateStatistics (LogicalWindow &op, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< NodeStatisticsPropagateChildren (LogicalOperator &node, unique_ptr< LogicalOperator > &node_ptr)
 
unique_ptr< BaseStatisticsStatisticsFromValue (const Value &input)
 Return statistics from a constant value.
 
FilterPropagateResult PropagateComparison (BaseStatistics &left, BaseStatistics &right, ExpressionType comparison)
 Run a comparison with two sets of statistics, returns if the comparison will always returns true/false or not.
 
void UpdateFilterStatistics (BaseStatistics &input, ExpressionType comparison_type, const Value &constant)
 Update filter statistics from a filter with a constant.
 
void UpdateFilterStatistics (BaseStatistics &lstats, BaseStatistics &rstats, ExpressionType comparison_type)
 Update statistics from a filter between two stats.
 
void UpdateFilterStatistics (Expression &left, Expression &right, ExpressionType comparison_type)
 Update filter statistics from a generic comparison.
 
void UpdateFilterStatistics (Expression &condition)
 Update filter statistics from an expression.
 
void SetStatisticsNotNull (ColumnBinding binding)
 Set the statistics of a specific column binding to not contain null values.
 
FilterPropagateResult HandleFilter (unique_ptr< Expression > &condition)
 Propagate a filter condition.
 
FilterPropagateResult PropagateTableFilter (ColumnBinding stats_binding, BaseStatistics &stats, TableFilter &filter)
 Run a comparison between the statistics and the table filter; returns the prune result.
 
void UpdateFilterStatistics (BaseStatistics &input, const TableFilter &filter)
 Update filter statistics from a TableFilter.
 
void AddCardinalities (unique_ptr< NodeStatistics > &stats, NodeStatistics &new_stats)
 Add cardinalities together (i.e. new max is stats.max + new_stats.max): used for union.
 
void MultiplyCardinalities (unique_ptr< NodeStatistics > &stats, NodeStatistics &new_stats)
 
void CreateFilterFromJoinStats (unique_ptr< LogicalOperator > &child, unique_ptr< Expression > &expr, const BaseStatistics &stats_before, const BaseStatistics &stats_after)
 Creates and pushes down a filter based on join statistics.
 
unique_ptr< BaseStatisticsPropagateExpression (unique_ptr< Expression > &expr)
 
unique_ptr< BaseStatisticsPropagateExpression (Expression &expr, unique_ptr< Expression > &expr_ptr)
 
unique_ptr< BaseStatisticsPropagateExpression (BoundAggregateExpression &expr, unique_ptr< Expression > &expr_ptr)
 Run a comparison between the statistics and the table filter; returns the prune result.
 
unique_ptr< BaseStatisticsPropagateExpression (BoundBetweenExpression &expr, unique_ptr< Expression > &expr_ptr)
 
unique_ptr< BaseStatisticsPropagateExpression (BoundCaseExpression &expr, unique_ptr< Expression > &expr_ptr)
 
unique_ptr< BaseStatisticsPropagateExpression (BoundCastExpression &expr, unique_ptr< Expression > &expr_ptr)
 
unique_ptr< BaseStatisticsPropagateExpression (BoundConjunctionExpression &expr, unique_ptr< Expression > &expr_ptr)
 
unique_ptr< BaseStatisticsPropagateExpression (BoundFunctionExpression &expr, unique_ptr< Expression > &expr_ptr)
 
unique_ptr< BaseStatisticsPropagateExpression (BoundComparisonExpression &expr, unique_ptr< Expression > &expr_ptr)
 
unique_ptr< BaseStatisticsPropagateExpression (BoundConstantExpression &expr, unique_ptr< Expression > &expr_ptr)
 
unique_ptr< BaseStatisticsPropagateExpression (BoundColumnRefExpression &expr, unique_ptr< Expression > &expr_ptr)
 
unique_ptr< BaseStatisticsPropagateExpression (BoundOperatorExpression &expr, unique_ptr< Expression > &expr_ptr)
 
void TryExecuteAggregates (LogicalAggregate &op, unique_ptr< LogicalOperator > &node_ptr)
 Try to execute aggregates using only the statistics if possible.
 
void ReplaceWithEmptyResult (unique_ptr< LogicalOperator > &node)
 
bool ExpressionIsConstant (Expression &expr, const Value &val)
 
bool ExpressionIsConstantOrNull (Expression &expr, const Value &val)
 
unique_ptr< NodeStatisticsPropagateUnion (LogicalSetOperation &setop, unique_ptr< LogicalOperator > &node_ptr)
 

Private Attributes

Optimizeroptimizer
 
ClientContextcontext
 
optional_ptr< LogicalOperatorroot
 The root of the query plan.
 
column_binding_map_t< unique_ptr< BaseStatistics > > statistics_map
 The map of ColumnBinding -> statistics for the various nodes.
 
unique_ptr< NodeStatisticsnode_stats
 Node stats for the current node.
 

Member Function Documentation

◆ GetStatisticsMap()

column_binding_map_t< unique_ptr< BaseStatistics > > duckdb::StatisticsPropagator::GetStatisticsMap ( )
inline
51374 {
51375 return std::move(statistics_map);
51376 }
column_binding_map_t< unique_ptr< BaseStatistics > > statistics_map
The map of ColumnBinding -> statistics for the various nodes.
Definition duckdb.hpp:51464

◆ MultiplyCardinalities()

void duckdb::StatisticsPropagator::MultiplyCardinalities ( unique_ptr< NodeStatistics > &  stats,
NodeStatistics new_stats 
)
private

Multiply the cardinalities together (i.e. new max cardinality is stats.max * new_stats.max): used for joins/cross products


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