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

A class representing a group within cascade optimizer. 更多...

#include <group.h>

Public 成员函数

 Group (int id, GroupExpr *expr, Memo *memo)
 Constructor for the Group class. A Group tracks both logical and physical M_EXPRs. 更多...
 
void add_expr (GroupExpr *expr)
 Adds an expression to the group. 更多...
 
bool set_expr_cost (GroupExpr *expr, double cost)
 Sets the cost of a given expression in the group. 更多...
 
GroupExprget_winner ()
 
const std::vector< GroupExpr * > & get_logical_expressions () const
 Gets the logical expressions in the group.
 
const std::vector< GroupExpr * > & get_physical_expressions () const
 Gets the physical expressions in the group.
 
double get_cost_lb ()
 Gets the cost lower bound. 更多...
 
void set_explored ()
 Marks the group as explored.
 
bool has_explored ()
 Checks if the group has been explored.
 
int get_id () const
 
GroupExprget_logical_expression ()
 
LogicalPropertyget_logical_prop ()
 dump the group info, for debug
 
void dump () const
 

Private 属性

int id_
 
std::tuple< double, GroupExpr * > winner_
 
bool has_explored_
 
std::vector< GroupExpr * > logical_expressions_
 
std::vector< GroupExpr * > physical_expressions_
 
unique_ptr< LogicalPropertylogical_prop_ = nullptr
 

详细描述

A class representing a group within cascade optimizer.

This class manages a group of expressions and their associated costs, and keeps track of whether the group has been explored.

构造及析构函数说明

◆ Group()

Group::Group ( int  id,
GroupExpr expr,
Memo memo 
)

Constructor for the Group class. A Group tracks both logical and physical M_EXPRs.

参数
idThe unique identifier for the group.

成员函数说明

◆ add_expr()

void Group::add_expr ( GroupExpr expr)

Adds an expression to the group.

参数
exprThe expression to add.

◆ get_cost_lb()

double Group::get_cost_lb ( )
inline

Gets the cost lower bound.

注解
This function is a work in progress (WIP).

◆ get_winner()

GroupExpr * Group::get_winner ( )
返回
The expression with the lowest cost.

◆ set_expr_cost()

bool Group::set_expr_cost ( GroupExpr expr,
double  cost 
)

Sets the cost of a given expression in the group.

参数
exprThe expression for which to set the cost.
costThe cost associated with the expression.
返回
True if the cost was successfully set, false if the expression is not setted.

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