1#ifndef SQL_ITERATORS_REF_ROW_ITERATORS_H_
2#define SQL_ITERATORS_REF_ROW_ITERATORS_H_
46template <
bool Reverse>
51 double expected_rows,
ha_rows *examined_rows)
79 double expected_rows,
ha_rows *examined_rows);
106 bool Init()
override;
134 bool Init()
override;
156 bool use_limit,
ha_rows *examined_rows);
159 bool Init()
override;
190 bool Init()
override;
240 bool use_order,
bool is_unique,
ha_rows *examined_rows);
242 bool Init()
override;
271 bool Init()
override;
Row iterators that scan a single table without reference to other tables or iterators.
An iterator that switches between another iterator (typically a RefIterator or similar) and a TableSc...
Definition: ref_row_iterators.h:262
AlternativeIterator(THD *thd, TABLE *table, unique_ptr_destroy_only< RowIterator > source, unique_ptr_destroy_only< RowIterator > table_scan_iterator, Index_lookup *ref)
Definition: ref_row_iterators.cc:766
std::vector< bool * > m_applicable_cond_guards
Definition: ref_row_iterators.h:286
void UnlockRow() override
Definition: ref_row_iterators.h:281
RowIterator * m_last_iterator_inited
Definition: ref_row_iterators.h:294
int Read() override
Read a single row.
Definition: ref_row_iterators.h:273
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:783
void SetNullRowFlag(bool is_null_row) override
Mark the current row buffer as containing a NULL row or not, so that if you read from it and the flag...
Definition: ref_row_iterators.h:275
RowIterator * m_iterator
Definition: ref_row_iterators.h:290
TABLE *const m_table
Definition: ref_row_iterators.h:304
unique_ptr_destroy_only< RowIterator > m_source_iterator
Definition: ref_row_iterators.h:298
unique_ptr_destroy_only< RowIterator > m_table_scan_iterator
Definition: ref_row_iterators.h:301
An iterator that reads from a table where only a single row is known to be matching,...
Definition: ref_row_iterators.h:128
bool m_first_record_since_init
Definition: ref_row_iterators.h:146
void UnlockRow() override
Rows from const tables are read once but potentially used multiple times during execution of a query.
Definition: ref_row_iterators.h:142
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:147
Index_lookup *const m_ref
Definition: ref_row_iterators.h:145
ConstIterator(THD *thd, TABLE *table, Index_lookup *table_ref, ha_rows *examined_rows)
Definition: ref_row_iterators.cc:76
int Read() override
Read a constant table when there is at most one matching row, using an index lookup.
Definition: ref_row_iterators.cc:96
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:82
Definition: ref_row_iterators.h:183
QEP_TAB * m_qep_tab
Definition: ref_row_iterators.h:194
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:490
~DynamicRangeIterator() override
Definition: ref_row_iterators.cc:484
MEM_ROOT m_mem_root
Definition: ref_row_iterators.h:198
bool m_quick_traced_before
Used by optimizer tracing to decide whether or not dynamic range analysis of this select has been tra...
Definition: ref_row_iterators.h:210
unique_ptr_destroy_only< RowIterator > m_iterator
Definition: ref_row_iterators.h:200
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:584
DynamicRangeIterator(THD *thd, TABLE *table, QEP_TAB *qep_tab, ha_rows *examined_rows)
Definition: ref_row_iterators.cc:475
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:212
Like RefIterator, but used in situations where we're guaranteed to have exactly zero or one rows for ...
Definition: ref_row_iterators.h:100
void UnlockRow() override
Since EQRefIterator may buffer a record, do not unlock it if it was not used in this invocation of EQ...
Definition: ref_row_iterators.cc:245
bool m_first_record_since_init
Definition: ref_row_iterators.h:120
int Read() override
Read row using unique key: eq_ref access method implementation.
Definition: ref_row_iterators.cc:162
bool Init() override
Read row using unique key: eq_ref access method implementation.
Definition: ref_row_iterators.cc:132
Index_lookup *const m_ref
Definition: ref_row_iterators.h:119
void StartPSIBatchMode() override
Start performance schema batch mode, if supported (otherwise ignored).
Definition: ref_row_iterators.h:116
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:121
EQRefIterator(THD *thd, TABLE *table, Index_lookup *ref, ha_rows *examined_rows)
Definition: ref_row_iterators.cc:109
An iterator that does a search through a full-text index.
Definition: ref_row_iterators.h:151
Index_lookup *const m_ref
Definition: ref_row_iterators.h:163
const bool m_use_limit
Definition: ref_row_iterators.h:166
const bool m_use_order
Definition: ref_row_iterators.h:165
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:647
Item_func_match *const m_ft_func
Definition: ref_row_iterators.h:164
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:670
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:167
FullTextSearchIterator(THD *thd, TABLE *table, Index_lookup *ref, Item_func_match *ft_func, bool use_order, bool use_limit, ha_rows *examined_rows)
Definition: ref_row_iterators.cc:592
~FullTextSearchIterator() override
Definition: ref_row_iterators.cc:640
Definition: item_func.h:3417
Read a table assumed to be included in execution of a pushed join.
Definition: ref_row_iterators.h:236
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:275
Index_lookup *const m_ref
Definition: ref_row_iterators.h:246
PushedJoinRefIterator(THD *thd, TABLE *table, Index_lookup *ref, bool use_order, bool is_unique, ha_rows *examined_rows)
Definition: ref_row_iterators.cc:250
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:260
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:250
const bool m_use_order
Definition: ref_row_iterators.h:247
const bool m_is_unique
Definition: ref_row_iterators.h:248
bool m_first_record_since_init
Definition: ref_row_iterators.h:249
Definition: sql_executor.h:259
For each record on the left side of a join (given in Init()), returns one or more matching rows from ...
Definition: ref_row_iterators.h:47
RefIterator(THD *thd, TABLE *table, Index_lookup *ref, bool use_order, double expected_rows, ha_rows *examined_rows)
Definition: ref_row_iterators.h:50
bool m_first_record_since_init
Definition: ref_row_iterators.h:67
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:66
Index_lookup *const m_ref
Definition: ref_row_iterators.h:63
bool m_is_mvi_unique_filter_enabled
Definition: ref_row_iterators.h:68
const bool m_use_order
Definition: ref_row_iterators.h:64
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:337
const double m_expected_rows
Definition: ref_row_iterators.h:65
int Read() override
Read a single row.
Like RefIterator, but after it's returned all its rows, will also search for rows that match NULL,...
Definition: ref_row_iterators.h:75
bool m_reading_first_row
Definition: ref_row_iterators.h:88
const double m_expected_rows
Definition: ref_row_iterators.h:89
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:711
Index_lookup *const m_ref
Definition: ref_row_iterators.h:86
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:90
const bool m_use_order
Definition: ref_row_iterators.h:87
~RefOrNullIterator() override
Definition: ref_row_iterators.cc:759
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:694
bool m_is_mvi_unique_filter_enabled
Definition: ref_row_iterators.h:91
RefOrNullIterator(THD *thd, TABLE *table, Index_lookup *ref, bool use_order, double expected_rows, ha_rows *examined_rows)
Reading of key with key reference and one part that may be NULL.
Definition: ref_row_iterators.cc:685
A context for reading through a single table using a chosen access method: index read,...
Definition: row_iterator.h:81
THD * thd() const
Definition: row_iterator.h:227
virtual void UnlockRow()=0
virtual int Read()=0
Read a single row.
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
Definition: row_iterator.h:233
TABLE * table() const
Definition: row_iterator.h:245
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
std::unique_ptr< T, Destroy_only< T > > unique_ptr_destroy_only
std::unique_ptr, but only destroying.
Definition: my_alloc.h:488
my_off_t ha_rows
Definition: my_base.h:1139
Some integer typedefs for easier portability.
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
PT & ref(PT *tp)
Definition: tablespace_impl.cc:358
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:41
Structure used for index-based lookups.
Definition: sql_opt_exec_shared.h:66
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82