MySQL 8.4.2
Source Code Documentation
RelationalExpression Struct Reference

Represents an expression tree in the relational algebra of joins. More...

#include <relational_expression.h>

Public Types

enum  Type {
  INNER_JOIN = static_cast<int>(JoinType::INNER) , LEFT_JOIN = static_cast<int>(JoinType::OUTER) , SEMIJOIN = static_cast<int>(JoinType::SEMI) , ANTIJOIN = static_cast<int>(JoinType::ANTI) ,
  STRAIGHT_INNER_JOIN = 101 , FULL_OUTER_JOIN = static_cast<int>(JoinType::FULL_OUTER) , MULTI_INNER_JOIN = 102 , TABLE = 100
}
 

Public Member Functions

 RelationalExpression (THD *thd)
 
const Mem_root_array< Item * > & pushable_conditions () const
 
void AddPushable (Item *cond)
 Add a condition that can be pushed down to the acces path for 'table'. More...
 

Public Attributes

enum RelationalExpression::Type type
 
table_map tables_in_subtree
 
hypergraph::NodeMap nodes_in_subtree
 
const Table_reftable
 
CompanionSetcompanion_set {nullptr}
 
RelationalExpressionleft
 
RelationalExpressionright
 
Mem_root_array< RelationalExpression * > multi_children
 
Mem_root_array< Item * > join_conditions
 
Mem_root_array< Item_eq_base * > equijoin_conditions
 
Mem_root_array< CachedPropertiesForPredicateproperties_for_join_conditions
 
Mem_root_array< CachedPropertiesForPredicateproperties_for_equijoin_conditions
 
bool join_conditions_reject_all_rows {false}
 
table_map conditions_used_tables {0}
 
int join_predicate_first {0}
 
int join_predicate_last {0}
 
Mem_root_array< ConflictRuleconflict_rules
 

Private Attributes

Mem_root_array< Item * > m_pushable_conditions
 Conditions that can be pushed down to the acces path for 'table'. More...
 

Detailed Description

Represents an expression tree in the relational algebra of joins.

Expressions are either tables, or joins of two expressions. (Joins can have join conditions, but more general filters are not represented in this structure.)

These are used as an abstract precursor to the join hypergraph; they represent the joins in the query block more or less directly, without any reordering. (The parser should largely have output a structure like this instead of Table_ref, but we are not there yet.) The only real manipulation we do on them is pushing down conditions, identifying equijoin conditions from other join conditions, and identifying join conditions that touch given tables (also a form of pushdown).

Member Enumeration Documentation

◆ Type

Enumerator
INNER_JOIN 
LEFT_JOIN 
SEMIJOIN 

Left semijoin.

ANTIJOIN 

Left antijoin.

STRAIGHT_INNER_JOIN 
FULL_OUTER_JOIN 
MULTI_INNER_JOIN 
TABLE 

Constructor & Destructor Documentation

◆ RelationalExpression()

RelationalExpression::RelationalExpression ( THD thd)
inlineexplicit

Member Function Documentation

◆ AddPushable()

void RelationalExpression::AddPushable ( Item cond)
inline

Add a condition that can be pushed down to the acces path for 'table'.

◆ pushable_conditions()

const Mem_root_array< Item * > & RelationalExpression::pushable_conditions ( ) const
inline

Member Data Documentation

◆ companion_set

CompanionSet* RelationalExpression::companion_set {nullptr}

◆ conditions_used_tables

table_map RelationalExpression::conditions_used_tables {0}

◆ conflict_rules

Mem_root_array<ConflictRule> RelationalExpression::conflict_rules

◆ equijoin_conditions

Mem_root_array<Item_eq_base *> RelationalExpression::equijoin_conditions

◆ join_conditions

Mem_root_array<Item *> RelationalExpression::join_conditions

◆ join_conditions_reject_all_rows

bool RelationalExpression::join_conditions_reject_all_rows {false}

◆ join_predicate_first

int RelationalExpression::join_predicate_first {0}

◆ join_predicate_last

int RelationalExpression::join_predicate_last {0}

◆ left

RelationalExpression* RelationalExpression::left

◆ m_pushable_conditions

Mem_root_array<Item *> RelationalExpression::m_pushable_conditions
private

Conditions that can be pushed down to the acces path for 'table'.

◆ multi_children

Mem_root_array<RelationalExpression *> RelationalExpression::multi_children

◆ nodes_in_subtree

hypergraph::NodeMap RelationalExpression::nodes_in_subtree

◆ properties_for_equijoin_conditions

Mem_root_array<CachedPropertiesForPredicate> RelationalExpression::properties_for_equijoin_conditions

◆ properties_for_join_conditions

Mem_root_array<CachedPropertiesForPredicate> RelationalExpression::properties_for_join_conditions

◆ right

RelationalExpression * RelationalExpression::right

◆ table

const Table_ref* RelationalExpression::table

◆ tables_in_subtree

table_map RelationalExpression::tables_in_subtree

◆ type

enum RelationalExpression::Type RelationalExpression::type

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