MySQL 8.0.31
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)
 

Public Attributes

enum RelationalExpression::Type type
 
table_map tables_in_subtree
 
hypergraph::NodeMap nodes_in_subtree
 
const TABLE_LISTtable
 
Mem_root_array< Item * > join_conditions_pushable_to_this
 
int companion_set {-1}
 
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
 

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_LIST, 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 
ANTIJOIN 
STRAIGHT_INNER_JOIN 
FULL_OUTER_JOIN 
MULTI_INNER_JOIN 
TABLE 

Constructor & Destructor Documentation

◆ RelationalExpression()

RelationalExpression::RelationalExpression ( THD thd)
inlineexplicit

Member Data Documentation

◆ companion_set

int RelationalExpression::companion_set {-1}

◆ 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_pushable_to_this

Mem_root_array<Item *> RelationalExpression::join_conditions_pushable_to_this

◆ 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

◆ 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_LIST* 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: