MySQL 8.4.3
Source Code Documentation
NESTED_JOIN Struct Reference

Struct NESTED_JOIN is used to represent how tables are connected through outer join operations and semi-join operations to form a query block. More...

#include <nested_join.h>

Public Member Functions

 NESTED_JOIN ()
 

Public Attributes

mem_root_deque< Table_ref * > m_tables
 list of tables referenced in the nested join More...
 
table_map used_tables {0}
 
table_map not_null_tables {0}
 
plan_idx first_nested {0}
 Used for pointing out the first table in the plan being covered by this join nest. More...
 
bool natural_join_processed {false}
 Set to true when natural join or using information has been processed. More...
 
uint nj_total {0}
 Number of tables and outer join nests administered by this nested join object for the sake of cost analysis. More...
 
uint nj_counter {0}
 Used to count tables in the nested join in 2 isolated places: More...
 
nested_join_map nj_map {0}
 Bit identifying this nested join. More...
 
table_map sj_depends_on {0}
 Tables outside the semi-join that are used within the semi-join's ON condition (ie. More...
 
table_map sj_corr_tables {0}
 Outer non-trivially correlated tables, a true subset of sj_depends_on. More...
 
uint query_block_id {0}
 Query block id if this struct is generated from a subquery transform. More...
 
uint sj_enabled_strategies {0}
 Bitmap of which strategies are enabled for this semi-join nest. More...
 
mem_root_deque< Item * > sj_outer_exprs
 
mem_root_deque< Item * > sj_inner_exprs
 
Semijoin_mat_optimize sjm
 

Detailed Description

Struct NESTED_JOIN is used to represent how tables are connected through outer join operations and semi-join operations to form a query block.

Out of the parser, inner joins are also represented by NESTED_JOIN structs, but these are later flattened out by simplify_joins(). Some outer join nests are also flattened, when it can be determined that they can be processed as inner joins instead of outer joins.

Constructor & Destructor Documentation

◆ NESTED_JOIN()

NESTED_JOIN::NESTED_JOIN ( )
inline

Member Data Documentation

◆ first_nested

plan_idx NESTED_JOIN::first_nested {0}

Used for pointing out the first table in the plan being covered by this join nest.

It is used exclusively within make_outerjoin_info().

◆ m_tables

mem_root_deque<Table_ref *> NESTED_JOIN::m_tables

list of tables referenced in the nested join

◆ natural_join_processed

bool NESTED_JOIN::natural_join_processed {false}

Set to true when natural join or using information has been processed.

◆ nj_counter

uint NESTED_JOIN::nj_counter {0}

Used to count tables in the nested join in 2 isolated places:

  1. In make_outerjoin_info().
  2. check_interleaving_with_nj/backout_nj_state (these are called by the join optimizer. Before each use the counters are zeroed by Query_block::reset_nj_counters.

◆ nj_map

nested_join_map NESTED_JOIN::nj_map {0}

Bit identifying this nested join.

Only nested joins representing the outer join structure need this, other nests have bit set to zero.

◆ nj_total

uint NESTED_JOIN::nj_total {0}

Number of tables and outer join nests administered by this nested join object for the sake of cost analysis.

Includes direct member tables as well as tables included through semi-join nests, but notice that semi-join nests themselves are not counted.

◆ not_null_tables

table_map NESTED_JOIN::not_null_tables {0}

◆ query_block_id

uint NESTED_JOIN::query_block_id {0}

Query block id if this struct is generated from a subquery transform.

◆ sj_corr_tables

table_map NESTED_JOIN::sj_corr_tables {0}

Outer non-trivially correlated tables, a true subset of sj_depends_on.

Also contains lateral dependencies from materialized derived tables contained inside the semi-join inner tables.

◆ sj_depends_on

table_map NESTED_JOIN::sj_depends_on {0}

Tables outside the semi-join that are used within the semi-join's ON condition (ie.

the subquery WHERE clause and optional IN equalities). Also contains lateral dependencies from materialized derived tables contained inside the semi-join inner tables.

◆ sj_enabled_strategies

uint NESTED_JOIN::sj_enabled_strategies {0}

Bitmap of which strategies are enabled for this semi-join nest.

◆ sj_inner_exprs

mem_root_deque<Item *> NESTED_JOIN::sj_inner_exprs

◆ sj_outer_exprs

mem_root_deque<Item *> NESTED_JOIN::sj_outer_exprs

◆ sjm

Semijoin_mat_optimize NESTED_JOIN::sjm

◆ used_tables

table_map NESTED_JOIN::used_tables {0}

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