MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
Public 成员函数 | Private 成员函数 | Private 属性 | 所有成员列表
NestedLoopJoinPhysicalOperator类 参考

最简单的两表(称为左表、右表)join算子 更多...

#include <join_physical_operator.h>

类 NestedLoopJoinPhysicalOperator 继承关系图:
PhysicalOperator PhysicalOperator OperatorNode OperatorNode

Public 成员函数

PhysicalOperatorType type () const override
 
RC open (Trx *trx) override
 
RC next () override
 
RC close () override
 
Tuplecurrent_tuple () override
 
PhysicalOperatorType type () const override
 
OpType get_op_type () const override
 
virtual double calculate_cost (LogicalProperty *prop, const vector< LogicalProperty * > &child_log_props, CostModel *cm) override
 Calculates the cost of a logical operation. 更多...
 
RC open (Trx *trx) override
 
RC next () override
 
RC close () override
 
Tuplecurrent_tuple () override
 
- Public 成员函数 继承自 PhysicalOperator
virtual string name () const
 
virtual string param () const
 
bool is_physical () const override
 
bool is_logical () const override
 
virtual PhysicalOperatorType type () const =0
 
virtual RC open (Trx *trx)=0
 
virtual RC next ()
 
virtual RC next (Chunk &chunk)
 
virtual RC close ()=0
 
virtual Tuplecurrent_tuple ()
 
virtual RC tuple_schema (TupleSchema &schema) const
 
void add_child (unique_ptr< PhysicalOperator > oper)
 
vector< unique_ptr< PhysicalOperator > > & children ()
 
- Public 成员函数 继承自 OperatorNode
virtual OpType get_op_type () const
 
virtual bool is_physical () const =0
 
virtual bool is_logical () const =0
 
virtual uint64_t hash () const
 
virtual bool operator== (const OperatorNode &other) const
 
virtual unique_ptr< LogicalPropertyfind_log_prop (const vector< LogicalProperty * > &log_props)
 Generate the logical property of the operator node using the input logical properties. 更多...
 
virtual double calculate_cost (LogicalProperty *prop, const vector< LogicalProperty * > &child_log_props, CostModel *cm)
 Calculates the cost of a logical operation. 更多...
 
void add_general_child (OperatorNode *child)
 
vector< OperatorNode * > & get_general_children ()
 

Private 成员函数

RC left_next ()
 
RC right_next ()
 左表遍历下一条数据
 
RC left_next ()
 
RC right_next ()
 左表遍历下一条数据
 

Private 属性

Trxtrx_ = nullptr
 右表遍历下一条数据,如果上一轮结束了就重新开始新的一轮
 
PhysicalOperatorleft_ = nullptr
 左表右表的真实对象是在PhysicalOperator::children_中,这里是为了写的时候更简单
 
PhysicalOperatorright_ = nullptr
 
Tupleleft_tuple_ = nullptr
 
Tupleright_tuple_ = nullptr
 
JoinedTuple joined_tuple_
 
bool round_done_ = true
 当前关联的左右两个tuple
 
bool right_closed_ = true
 右表遍历的一轮是否结束
 

额外继承的成员函数

- Protected 属性 继承自 PhysicalOperator
vector< unique_ptr< PhysicalOperator > > children_
 
- Protected 属性 继承自 OperatorNode
vector< OperatorNode * > general_children_
 

详细描述

最简单的两表(称为左表、右表)join算子

依次遍历左表的每一行,然后关联右表的每一行

成员函数说明

◆ calculate_cost()

virtual double NestedLoopJoinPhysicalOperator::calculate_cost ( LogicalProperty prop,
const vector< LogicalProperty * > &  child_log_props,
CostModel cm 
)
inlineoverridevirtual

Calculates the cost of a logical operation.

This function is intended to be overridden in derived classes. It calculates the cost associated with a specific logical property, taking into account the provided child logical properties and a cost model.

参数
propA pointer to the logical property for which the cost is being calculated.
child_log_propsA vector containing pointers to child logical properties.
cmA pointer to the cost model used for calculating the cost.
返回
The calculated cost as a double.

重载 OperatorNode .

◆ close() [1/2]

RC NestedLoopJoinPhysicalOperator::close ( )
overridevirtual

实现了 PhysicalOperator.

◆ close() [2/2]

RC NestedLoopJoinPhysicalOperator::close ( )
overridevirtual

实现了 PhysicalOperator.

◆ current_tuple() [1/2]

Tuple * NestedLoopJoinPhysicalOperator::current_tuple ( )
overridevirtual

重载 PhysicalOperator .

◆ current_tuple() [2/2]

Tuple * NestedLoopJoinPhysicalOperator::current_tuple ( )
overridevirtual

重载 PhysicalOperator .

◆ get_op_type()

OpType NestedLoopJoinPhysicalOperator::get_op_type ( ) const
inlineoverridevirtual

TODO: add this function TODO: unify logical and physical OpType

重载 OperatorNode .

◆ next() [1/2]

RC NestedLoopJoinPhysicalOperator::next ( )
overridevirtual

重载 PhysicalOperator .

◆ next() [2/2]

RC NestedLoopJoinPhysicalOperator::next ( )
overridevirtual

重载 PhysicalOperator .

◆ open() [1/2]

RC NestedLoopJoinPhysicalOperator::open ( Trx trx)
overridevirtual

实现了 PhysicalOperator.

◆ open() [2/2]

RC NestedLoopJoinPhysicalOperator::open ( Trx trx)
overridevirtual

实现了 PhysicalOperator.

◆ type() [1/2]

PhysicalOperatorType NestedLoopJoinPhysicalOperator::type ( ) const
inlineoverridevirtual

实现了 PhysicalOperator.

◆ type() [2/2]

PhysicalOperatorType NestedLoopJoinPhysicalOperator::type ( ) const
inlineoverridevirtual

实现了 PhysicalOperator.


该类的文档由以下文件生成: