14#include "common/lang/vector.h"
15#include "common/lang/memory.h"
16#include "sql/optimizer/cascade/property.h"
17#include "sql/optimizer/cascade/cost_model.h"
42 LOGICALPHYSICALDELIMITER,
80 virtual OpType
get_op_type()
const {
return OpType::UNDEFINED; }
95 virtual uint64_t
hash()
const {
return std::hash<int>()(
static_cast<int>(
get_op_type())); }
100 if (general_children_.size() != other.general_children_.size())
103 for (
size_t idx = 0; idx < general_children_.size(); idx++) {
104 auto &child = general_children_[idx];
105 auto &other_child = other.general_children_[idx];
107 if (*child != *other_child)
117 virtual unique_ptr<LogicalProperty>
find_log_prop(
const vector<LogicalProperty *> &log_props) {
return nullptr; }
136 void add_general_child(
OperatorNode *child) { general_children_.push_back(child); }
138 vector<OperatorNode *> &get_general_children() {
return general_children_; }
143 vector<OperatorNode *> general_children_;
cost model in cost-based optimization(CBO)
Definition: cost_model.h:19
Logical Property, such as the cardinality of logical operator
Definition: property.h:20
Definition: operator_node.h:69
virtual double calculate_cost(LogicalProperty *prop, const vector< LogicalProperty * > &child_log_props, CostModel *cm)
Calculates the cost of a logical operation.
Definition: operator_node.h:131
virtual OpType get_op_type() const
Definition: operator_node.h:80
virtual bool is_physical() const =0
virtual unique_ptr< LogicalProperty > find_log_prop(const vector< LogicalProperty * > &log_props)
Generate the logical property of the operator node using the input logical properties.
Definition: operator_node.h:117
virtual bool is_logical() const =0
virtual uint64_t hash() const
Definition: operator_node.h:95