MySQL 8.4.2
Source Code Documentation
QEP_shared Class Reference

Holds members common to JOIN_TAB and QEP_TAB. More...

#include <sql_opt_exec_shared.h>

Public Member Functions

 QEP_shared ()
 
JOINjoin () const
 
void set_join (JOIN *j)
 
plan_idx idx () const
 
void set_idx (plan_idx i)
 
TABLEtable () const
 
void set_table (TABLE *t)
 
POSITIONposition () const
 
void set_position (POSITION *p)
 
Semijoin_mat_execsj_mat_exec () const
 
void set_sj_mat_exec (Semijoin_mat_exec *s)
 
plan_idx first_sj_inner ()
 
plan_idx last_sj_inner ()
 
plan_idx first_inner ()
 
void set_first_inner (plan_idx i)
 
void set_last_inner (plan_idx i)
 
void set_first_sj_inner (plan_idx i)
 
void set_last_sj_inner (plan_idx i)
 
void set_first_upper (plan_idx i)
 
plan_idx last_inner ()
 
plan_idx first_upper ()
 
Index_lookupref ()
 
uint index () const
 
void set_index (uint i)
 
enum join_type type () const
 
void set_type (enum join_type t)
 
Itemcondition () const
 
void set_condition (Item *c)
 
bool condition_is_pushed_to_sort () const
 
void mark_condition_as_pushed_to_sort ()
 
Key_mapkeys ()
 
ha_rows records () const
 
void set_records (ha_rows r)
 
AccessPathrange_scan () const
 
void set_range_scan (AccessPath *q)
 
table_map prefix_tables () const
 
table_map added_tables () const
 
Item_func_matchft_func () const
 
void set_ft_func (Item_func_match *f)
 
void set_prefix_tables (table_map prefix_tables_arg, table_map prev_tables_arg)
 Set available tables for a table in a join plan. More...
 
void add_prefix_tables (table_map tables)
 Add an available set of tables for a table in a join plan. More...
 
bool is_first_inner_for_outer_join () const
 
bool is_inner_table_of_outer_join () const
 
bool is_single_inner_of_semi_join () const
 
bool is_single_inner_of_outer_join () const
 
void set_skip_records_in_range (bool skip_records_in_range)
 
bool skip_records_in_range () const
 

Private Attributes

JOINm_join
 
plan_idx m_idx
 Index of structure in array: More...
 
TABLEm_table
 Corresponding table. Might be an internal temporary one. More...
 
POSITIONm_position
 Points into best_positions array. Includes cost info. More...
 
Semijoin_mat_execm_sj_mat_exec
 Struct needed for materialization of semi-join. More...
 
plan_idx m_first_sj_inner
 Boundaries of semijoin inner tables around this table. More...
 
plan_idx m_last_sj_inner
 
plan_idx m_first_inner
 first inner table for including outer join More...
 
plan_idx m_last_inner
 last table table for embedding outer join More...
 
plan_idx m_first_upper
 first inner table for embedding outer join More...
 
Index_lookup m_ref
 Used to do index-based look up based on a key value. More...
 
uint m_index
 ID of index used for index scan or semijoin LooseScan. More...
 
enum join_type m_type
 Type of chosen access method (scan, etc). More...
 
Itemm_condition
 Table condition, ie condition to be evaluated for a row from this table. More...
 
bool m_condition_is_pushed_to_sort = false
 Whether the condition in m_condition is evaluated in front of a sort, so that it does not need to be evaluated again (unless it is outer to an inner join; see the relevant comments in SortingIterator::Init(). More...
 
Key_map m_keys
 All keys with can be used. More...
 
ha_rows m_records
 Either number of rows in the table or 1 for const table. More...
 
AccessPathm_range_scan = nullptr
 Non-NULL if quick-select used. More...
 
table_map prefix_tables_map
 The set of all tables available in the join prefix for this table, including the table handled by this JOIN_TAB. More...
 
table_map added_tables_map
 The set of tables added for this table, compared to the previous table in the join prefix. More...
 
Item_func_matchm_ft_func
 FT function. More...
 
bool m_skip_records_in_range
 Set if index dive can be skipped for this query. More...
 

Detailed Description

Holds members common to JOIN_TAB and QEP_TAB.

Constructor & Destructor Documentation

◆ QEP_shared()

QEP_shared::QEP_shared ( )
inline

Member Function Documentation

◆ add_prefix_tables()

void QEP_shared::add_prefix_tables ( table_map  tables)
inline

Add an available set of tables for a table in a join plan.

Parameters
tablesSet of tables added for this table in plan.

◆ added_tables()

table_map QEP_shared::added_tables ( ) const
inline

◆ condition()

Item * QEP_shared::condition ( ) const
inline

◆ condition_is_pushed_to_sort()

bool QEP_shared::condition_is_pushed_to_sort ( ) const
inline

◆ first_inner()

plan_idx QEP_shared::first_inner ( )
inline

◆ first_sj_inner()

plan_idx QEP_shared::first_sj_inner ( )
inline

◆ first_upper()

plan_idx QEP_shared::first_upper ( )
inline

◆ ft_func()

Item_func_match * QEP_shared::ft_func ( ) const
inline

◆ idx()

plan_idx QEP_shared::idx ( ) const
inline

◆ index()

uint QEP_shared::index ( ) const
inline

◆ is_first_inner_for_outer_join()

bool QEP_shared::is_first_inner_for_outer_join ( ) const
inline

◆ is_inner_table_of_outer_join()

bool QEP_shared::is_inner_table_of_outer_join ( ) const
inline

◆ is_single_inner_of_outer_join()

bool QEP_shared::is_single_inner_of_outer_join ( ) const
inline

◆ is_single_inner_of_semi_join()

bool QEP_shared::is_single_inner_of_semi_join ( ) const
inline

◆ join()

JOIN * QEP_shared::join ( ) const
inline

◆ keys()

Key_map & QEP_shared::keys ( )
inline

◆ last_inner()

plan_idx QEP_shared::last_inner ( )
inline

◆ last_sj_inner()

plan_idx QEP_shared::last_sj_inner ( )
inline

◆ mark_condition_as_pushed_to_sort()

void QEP_shared::mark_condition_as_pushed_to_sort ( )
inline

◆ position()

POSITION * QEP_shared::position ( ) const
inline

◆ prefix_tables()

table_map QEP_shared::prefix_tables ( ) const
inline

◆ range_scan()

AccessPath * QEP_shared::range_scan ( ) const
inline

◆ records()

ha_rows QEP_shared::records ( ) const
inline

◆ ref()

Index_lookup & QEP_shared::ref ( void  )
inline

◆ set_condition()

void QEP_shared::set_condition ( Item c)
inline

◆ set_first_inner()

void QEP_shared::set_first_inner ( plan_idx  i)
inline

◆ set_first_sj_inner()

void QEP_shared::set_first_sj_inner ( plan_idx  i)
inline

◆ set_first_upper()

void QEP_shared::set_first_upper ( plan_idx  i)
inline

◆ set_ft_func()

void QEP_shared::set_ft_func ( Item_func_match f)
inline

◆ set_idx()

void QEP_shared::set_idx ( plan_idx  i)
inline

◆ set_index()

void QEP_shared::set_index ( uint  i)
inline

◆ set_join()

void QEP_shared::set_join ( JOIN j)
inline

◆ set_last_inner()

void QEP_shared::set_last_inner ( plan_idx  i)
inline

◆ set_last_sj_inner()

void QEP_shared::set_last_sj_inner ( plan_idx  i)
inline

◆ set_position()

void QEP_shared::set_position ( POSITION p)
inline

◆ set_prefix_tables()

void QEP_shared::set_prefix_tables ( table_map  prefix_tables_arg,
table_map  prev_tables_arg 
)
inline

Set available tables for a table in a join plan.

Parameters
prefix_tables_argSet of tables available for this plan
prev_tables_argSet of tables available for previous table, used to calculate set of tables added for this table.

◆ set_range_scan()

void QEP_shared::set_range_scan ( AccessPath q)
inline

◆ set_records()

void QEP_shared::set_records ( ha_rows  r)
inline

◆ set_sj_mat_exec()

void QEP_shared::set_sj_mat_exec ( Semijoin_mat_exec s)
inline

◆ set_skip_records_in_range()

void QEP_shared::set_skip_records_in_range ( bool  skip_records_in_range)
inline

◆ set_table()

void QEP_shared::set_table ( TABLE t)
inline

◆ set_type()

void QEP_shared::set_type ( enum join_type  t)
inline

◆ sj_mat_exec()

Semijoin_mat_exec * QEP_shared::sj_mat_exec ( ) const
inline

◆ skip_records_in_range()

bool QEP_shared::skip_records_in_range ( ) const
inline

◆ table()

TABLE * QEP_shared::table ( ) const
inline

◆ type()

enum join_type QEP_shared::type ( ) const
inline

Member Data Documentation

◆ added_tables_map

table_map QEP_shared::added_tables_map
private

The set of tables added for this table, compared to the previous table in the join prefix.

◆ m_condition

Item* QEP_shared::m_condition
private

Table condition, ie condition to be evaluated for a row from this table.

Notice that the condition may refer to rows from previous tables in the join prefix, as well as outer tables.

◆ m_condition_is_pushed_to_sort

bool QEP_shared::m_condition_is_pushed_to_sort = false
private

Whether the condition in m_condition is evaluated in front of a sort, so that it does not need to be evaluated again (unless it is outer to an inner join; see the relevant comments in SortingIterator::Init().

Note that m_condition remains non-nullptr in this case, for purposes of the (non-tree) EXPLAIN and for filesort to build up its read maps.

◆ m_first_inner

plan_idx QEP_shared::m_first_inner
private

first inner table for including outer join

◆ m_first_sj_inner

plan_idx QEP_shared::m_first_sj_inner
private

Boundaries of semijoin inner tables around this table.

Valid only once final QEP has been chosen. Depending on the strategy, they may define an interval (all tables inside are inner of a semijoin) or not. last_sj_inner is not set for Duplicates Weedout.

◆ m_first_upper

plan_idx QEP_shared::m_first_upper
private

first inner table for embedding outer join

◆ m_ft_func

Item_func_match* QEP_shared::m_ft_func
private

FT function.

◆ m_idx

plan_idx QEP_shared::m_idx
private

Index of structure in array:

  • NO_PLAN_IDX if before get_best_combination()
  • index of pointer to this JOIN_TAB, in JOIN::best_ref array
  • index of this QEP_TAB, in JOIN::qep array.

◆ m_index

uint QEP_shared::m_index
private

ID of index used for index scan or semijoin LooseScan.

◆ m_join

JOIN* QEP_shared::m_join
private

◆ m_keys

Key_map QEP_shared::m_keys
private

All keys with can be used.

Used by add_key_field() (optimization time) and execution of dynamic range (DynamicRangeIterator), and EXPLAIN.

◆ m_last_inner

plan_idx QEP_shared::m_last_inner
private

last table table for embedding outer join

◆ m_last_sj_inner

plan_idx QEP_shared::m_last_sj_inner
private

◆ m_position

POSITION* QEP_shared::m_position
private

Points into best_positions array. Includes cost info.

◆ m_range_scan

AccessPath* QEP_shared::m_range_scan = nullptr
private

Non-NULL if quick-select used.

Filled in optimization, converted to a RowIterator before execution (used to find rows), and in EXPLAIN.

◆ m_records

ha_rows QEP_shared::m_records
private

Either number of rows in the table or 1 for const table.

Used in optimization, and also in execution for FOUND_ROWS().

◆ m_ref

Index_lookup QEP_shared::m_ref
private

Used to do index-based look up based on a key value.

Used when we read constant tables, in misc optimization (like remove_const()), and in execution.

◆ m_sj_mat_exec

Semijoin_mat_exec* QEP_shared::m_sj_mat_exec
private

Struct needed for materialization of semi-join.

Set for a materialized temporary table, and NULL for all other join_tabs (except when materialization is in progress,

See also
join_materialize_semijoin()).

◆ m_skip_records_in_range

bool QEP_shared::m_skip_records_in_range
private

Set if index dive can be skipped for this query.

See comments for check_skip_records_in_range_qualification.

◆ m_table

TABLE* QEP_shared::m_table
private

Corresponding table. Might be an internal temporary one.

◆ m_type

enum join_type QEP_shared::m_type
private

Type of chosen access method (scan, etc).

◆ prefix_tables_map

table_map QEP_shared::prefix_tables_map
private

The set of all tables available in the join prefix for this table, including the table handled by this JOIN_TAB.


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