17#include "common/sys/rc.h"
18#include "sql/operator/physical_operator.h"
19#include "storage/record/record_manager.h"
20#include "storage/record/record_scanner.h"
21#include "common/types.h"
36 string param()
const override;
39 OpType
get_op_type()
const override {
return OpType::SEQSCAN; }
40 virtual uint64_t
hash()
const override {
return 0; }
42 virtual bool operator==(
const OperatorNode &other)
const override {
return false; }
46 return (cm->io() + cm->
cpu_op()) * prop->get_card();
49 RC open(
Trx *trx)
override;
53 Tuple *current_tuple()
override;
55 void set_predicates(vector<unique_ptr<Expression>> &&exprs);
58 RC filter(
RowTuple &tuple,
bool &result);
61 Table *table_ =
nullptr;
63 ReadWriteMode mode_ = ReadWriteMode::READ_WRITE;
67 vector<unique_ptr<Expression>> predicates_;
cost model in cost-based optimization(CBO)
Definition: cost_model.h:19
double cpu_op()
cpu cost of building hash table
Definition: cost_model.h:32
Logical Property, such as the cardinality of logical operator
Definition: property.h:20
Definition: operator_node.h:69
与LogicalOperator对应,物理算子描述执行计划将如何执行
Definition: physical_operator.h:63
遍历某个表中所有记录
Definition: record_scanner.h:21
表示一个记录
Definition: record.h:101
一行数据的元组
Definition: tuple.h:159
表扫描物理算子
Definition: table_scan_physical_operator.h:30
virtual uint64_t hash() const override
Definition: table_scan_physical_operator.h:40
OpType get_op_type() const override
Definition: table_scan_physical_operator.h:39
double calculate_cost(LogicalProperty *prop, const vector< LogicalProperty * > &child_log_props, CostModel *cm) override
Calculates the cost of a logical operation.
Definition: table_scan_physical_operator.h:44
事务接口
Definition: trx.h:141
元组的抽象描述
Definition: tuple.h:66
PhysicalOperatorType
物理算子类型
Definition: physical_operator.h:36