MySQL  8.0.27
Source Code Documentation
QEP_TAB Class Reference

#include <sql_executor.h>

Inheritance diagram for QEP_TAB:
QEP_shared_owner

Public Types

enum  Setup_func { NO_SETUP , MATERIALIZE_TABLE_FUNCTION , MATERIALIZE_DERIVED , MATERIALIZE_SEMIJOIN }
 
enum  enum_op_type {
  OT_NONE , OT_AGGREGATE , OT_MATERIALIZE , OT_AGGREGATE_THEN_MATERIALIZE ,
  OT_AGGREGATE_INTO_TMP_TABLE , OT_WINDOWING_FUNCTION , OT_BNL , OT_BKA
}
 

Public Member Functions

 QEP_TAB ()
 
void init (JOIN_TAB *jt)
 Initializes the object from a JOIN_TAB. More...
 
void cleanup ()
 
Itemcondition_optim () const
 
void set_condition_optim ()
 
bool keyread_optim () const
 
void set_keyread_optim ()
 
bool reversed_access () const
 
void set_reversed_access (bool arg)
 
void set_table (TABLE *t)
 
uint get_sj_strategy () const
 
bool do_firstmatch () const
 Return true if join_tab should perform a FirstMatch action. More...
 
bool do_loosescan () const
 Return true if join_tab should perform a LooseScan action. More...
 
bool starts_weedout () const
 Return true if join_tab starts a Duplicate Weedout action. More...
 
bool finishes_weedout () const
 Return true if join_tab finishes a Duplicate Weedout action. More...
 
void init_join_cache (JOIN_TAB *join_tab)
 A helper function that allocates appropriate join cache object and sets next_query_block function of previous tab. More...
 
uint sjm_query_block_id () const
 
bool dynamic_range () const
 
bool use_order () const
 Use ordering provided by chosen index? More...
 
AccessPathaccess_path ()
 Construct an access path for reading from this table in the query, using the access method that has been determined previously (e.g., table scan, ref access, optional sort afterwards, etc.). More...
 
void push_index_cond (const JOIN_TAB *join_tab, uint keyno, Opt_trace_object *trace_obj)
 Try to extract and push the index condition down to table handler. More...
 
uint effective_index () const
 Return the index used for a table in a QEP. More...
 
bool pfs_batch_update (const JOIN *join) const
 
 QEP_TAB (const QEP_TAB &)
 
QEP_TABoperator= (const QEP_TAB &)
 
- Public Member Functions inherited from QEP_shared_owner
 QEP_shared_owner ()
 
void share_qs (QEP_shared_owner *other)
 Instructs to share the QEP_shared with another owner. More...
 
void set_qs (QEP_shared *q)
 
JOINjoin () const
 
void set_join (JOIN *j)
 
plan_idx idx () const
 
void set_idx (plan_idx i)
 
qep_tab_map idx_map () const
 
TABLEtable () const
 
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 () const
 
plan_idx last_sj_inner () const
 
plan_idx first_inner () const
 
plan_idx last_inner () const
 
plan_idx first_upper () const
 
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)
 
TABLE_REFref () const
 
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 *to)
 
bool condition_is_pushed_to_sort () const
 
void mark_condition_as_pushed_to_sort ()
 
Key_mapkeys () const
 
ha_rows records () const
 
void set_records (ha_rows r)
 
QUICK_SELECT_Iquick () const
 
void set_quick (QUICK_SELECT_I *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, table_map prev_tables)
 
void add_prefix_tables (table_map tables)
 
bool is_single_inner_of_semi_join () const
 
bool is_inner_table_of_outer_join () const
 
bool is_first_inner_for_outer_join () const
 
bool is_single_inner_for_outer_join () const
 
bool has_guarded_conds () const
 
bool and_with_condition (Item *tmp_cond)
 Extend join_tab->cond by AND'ing add_cond to it. More...
 
void set_skip_records_in_range (bool skip_records_in_range)
 
bool skip_records_in_range () const
 
void qs_cleanup ()
 

Public Attributes

TABLE_LISTtable_ref
 Pointer to table reference. More...
 
SJ_TMP_TABLEflush_weedout_table
 
SJ_TMP_TABLEcheck_weed_out_table
 
plan_idx firstmatch_return
 
uint loosescan_key_len
 
plan_idx match_tab
 
bool rematerialize
 Dependent table functions have to be materialized on each new scan. More...
 
Setup_func materialize_table = NO_SETUP
 
bool using_dynamic_range = false
 
bool needs_duplicate_removal = false
 true <=> remove duplicates on this table. More...
 
bool not_used_in_distinct
 
Itemhaving
 HAVING condition for checking prior saving a record into tmp table. More...
 
enum QEP_TAB::enum_op_type op_type = OT_NONE
 
Temp_table_paramtmp_table_param
 
Filesortfilesort
 
ORDERfilesort_pushed_order = nullptr
 If we pushed a global ORDER BY down onto this first table, that ORDER BY list will be preseved here. More...
 
uint ref_item_slice
 Slice number of the ref items array to switch to before reading rows from this table. More...
 
Itemm_condition_optim = nullptr
 Condition as it was set by the optimizer, used for EXPLAIN. More...
 
bool m_keyread_optim
 True if only index is going to be read for this table. More...
 
bool m_reversed_access
 True if reversed scan is used. More...
 
qep_tab_map lateral_derived_tables_depend_on_me
 Maps of all lateral derived tables which should be refreshed when execution reads a new row from this table. More...
 
Mem_root_array< const AccessPath * > * invalidators = nullptr
 

Additional Inherited Members

- Protected Attributes inherited from QEP_shared_owner
QEP_sharedm_qs
 

Member Enumeration Documentation

◆ enum_op_type

Enumerator
OT_NONE 
OT_AGGREGATE 
OT_MATERIALIZE 
OT_AGGREGATE_THEN_MATERIALIZE 
OT_AGGREGATE_INTO_TMP_TABLE 
OT_WINDOWING_FUNCTION 
OT_BNL 
OT_BKA 

◆ Setup_func

Enumerator
NO_SETUP 
MATERIALIZE_TABLE_FUNCTION 
MATERIALIZE_DERIVED 
MATERIALIZE_SEMIJOIN 

Constructor & Destructor Documentation

◆ QEP_TAB() [1/2]

QEP_TAB::QEP_TAB ( )
inline

◆ QEP_TAB() [2/2]

QEP_TAB::QEP_TAB ( const QEP_TAB )

Member Function Documentation

◆ condition_optim()

Item* QEP_TAB::condition_optim ( ) const
inline

◆ do_firstmatch()

bool QEP_TAB::do_firstmatch ( ) const
inline

Return true if join_tab should perform a FirstMatch action.

◆ do_loosescan()

bool QEP_TAB::do_loosescan ( ) const
inline

Return true if join_tab should perform a LooseScan action.

◆ dynamic_range()

bool QEP_TAB::dynamic_range ( ) const
inline
Returns
whether this is doing QS_DYNAMIC_RANGE

◆ finishes_weedout()

bool QEP_TAB::finishes_weedout ( ) const
inline

Return true if join_tab finishes a Duplicate Weedout action.

◆ keyread_optim()

bool QEP_TAB::keyread_optim ( ) const
inline

◆ operator=()

QEP_TAB& QEP_TAB::operator= ( const QEP_TAB )

◆ reversed_access()

bool QEP_TAB::reversed_access ( ) const
inline

◆ set_condition_optim()

void QEP_TAB::set_condition_optim ( )
inline

◆ set_keyread_optim()

void QEP_TAB::set_keyread_optim ( )
inline

◆ set_reversed_access()

void QEP_TAB::set_reversed_access ( bool  arg)
inline

◆ set_table()

void QEP_TAB::set_table ( TABLE t)
inline

◆ starts_weedout()

bool QEP_TAB::starts_weedout ( ) const
inline

Return true if join_tab starts a Duplicate Weedout action.

Member Data Documentation

◆ check_weed_out_table

SJ_TMP_TABLE* QEP_TAB::check_weed_out_table

◆ filesort

Filesort* QEP_TAB::filesort

◆ filesort_pushed_order

ORDER* QEP_TAB::filesort_pushed_order = nullptr

If we pushed a global ORDER BY down onto this first table, that ORDER BY list will be preseved here.

◆ firstmatch_return

plan_idx QEP_TAB::firstmatch_return

◆ flush_weedout_table

SJ_TMP_TABLE* QEP_TAB::flush_weedout_table

◆ having

Item* QEP_TAB::having

HAVING condition for checking prior saving a record into tmp table.

◆ invalidators

Mem_root_array<const AccessPath *>* QEP_TAB::invalidators = nullptr

◆ lateral_derived_tables_depend_on_me

qep_tab_map QEP_TAB::lateral_derived_tables_depend_on_me

Maps of all lateral derived tables which should be refreshed when execution reads a new row from this table.

Note
that if a LDT depends on t1 and t2, and t2 is after t1 in the plan, then only t2::lateral_derived_tables_depend_on_me gets the map of the LDT, for efficiency (less useless calls to QEP_TAB::refresh_lateral()) and clarity in EXPLAIN.

◆ loosescan_key_len

uint QEP_TAB::loosescan_key_len

◆ m_condition_optim

Item* QEP_TAB::m_condition_optim = nullptr

Condition as it was set by the optimizer, used for EXPLAIN.

m_condition may be overwritten at a later stage.

◆ m_keyread_optim

bool QEP_TAB::m_keyread_optim

True if only index is going to be read for this table.

This is the optimizer's decision.

◆ m_reversed_access

bool QEP_TAB::m_reversed_access

True if reversed scan is used.

This is the optimizer's decision.

◆ match_tab

plan_idx QEP_TAB::match_tab

◆ materialize_table

Setup_func QEP_TAB::materialize_table = NO_SETUP

◆ needs_duplicate_removal

bool QEP_TAB::needs_duplicate_removal = false

true <=> remove duplicates on this table.

◆ not_used_in_distinct

bool QEP_TAB::not_used_in_distinct

◆ op_type

enum QEP_TAB::enum_op_type QEP_TAB::op_type = OT_NONE

◆ ref_item_slice

uint QEP_TAB::ref_item_slice

Slice number of the ref items array to switch to before reading rows from this table.

◆ rematerialize

bool QEP_TAB::rematerialize

Dependent table functions have to be materialized on each new scan.

◆ table_ref

TABLE_LIST* QEP_TAB::table_ref

Pointer to table reference.

◆ tmp_table_param

Temp_table_param* QEP_TAB::tmp_table_param

◆ using_dynamic_range

bool QEP_TAB::using_dynamic_range = false

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