1#ifndef SQL_ITERATORS_REF_ROW_ITERATORS_H_
2#define SQL_ITERATORS_REF_ROW_ITERATORS_H_
47template <
bool Reverse>
52 double expected_rows,
ha_rows *examined_rows)
80 double expected_rows,
ha_rows *examined_rows);
107 bool Init()
override;
135 bool Init()
override;
157 bool use_limit,
ha_rows *examined_rows);
160 bool Init()
override;
191 bool Init()
override;
241 bool use_order,
bool is_unique,
ha_rows *examined_rows);
243 bool Init()
override;
272 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:263
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:769
std::vector< bool * > m_applicable_cond_guards
Definition: ref_row_iterators.h:287
void UnlockRow() override
Definition: ref_row_iterators.h:282
RowIterator * m_last_iterator_inited
Definition: ref_row_iterators.h:295
int Read() override
Read a single row.
Definition: ref_row_iterators.h:274
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:786
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:276
RowIterator * m_iterator
Definition: ref_row_iterators.h:291
TABLE *const m_table
Definition: ref_row_iterators.h:305
unique_ptr_destroy_only< RowIterator > m_source_iterator
Definition: ref_row_iterators.h:299
unique_ptr_destroy_only< RowIterator > m_table_scan_iterator
Definition: ref_row_iterators.h:302
An iterator that reads from a table where only a single row is known to be matching,...
Definition: ref_row_iterators.h:129
bool m_first_record_since_init
Definition: ref_row_iterators.h:147
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:143
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:148
Index_lookup *const m_ref
Definition: ref_row_iterators.h:146
ConstIterator(THD *thd, TABLE *table, Index_lookup *table_ref, ha_rows *examined_rows)
Definition: ref_row_iterators.cc:77
int Read() override
Read a constant table when there is at most one matching row, using an index lookup.
Definition: ref_row_iterators.cc:97
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:83
Definition: ref_row_iterators.h:184
QEP_TAB * m_qep_tab
Definition: ref_row_iterators.h:195
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:493
~DynamicRangeIterator() override
Definition: ref_row_iterators.cc:485
MEM_ROOT m_mem_root
Definition: ref_row_iterators.h:199
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:211
unique_ptr_destroy_only< RowIterator > m_iterator
Definition: ref_row_iterators.h:201
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:587
DynamicRangeIterator(THD *thd, TABLE *table, QEP_TAB *qep_tab, ha_rows *examined_rows)
Definition: ref_row_iterators.cc:476
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:213
Like RefIterator, but used in situations where we're guaranteed to have exactly zero or one rows for ...
Definition: ref_row_iterators.h:101
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:246
bool m_first_record_since_init
Definition: ref_row_iterators.h:121
int Read() override
Read row using unique key: eq_ref access method implementation.
Definition: ref_row_iterators.cc:163
bool Init() override
Read row using unique key: eq_ref access method implementation.
Definition: ref_row_iterators.cc:133
Index_lookup *const m_ref
Definition: ref_row_iterators.h:120
void StartPSIBatchMode() override
Start performance schema batch mode, if supported (otherwise ignored).
Definition: ref_row_iterators.h:117
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:122
EQRefIterator(THD *thd, TABLE *table, Index_lookup *ref, ha_rows *examined_rows)
Definition: ref_row_iterators.cc:110
An iterator that does a search through a full-text index.
Definition: ref_row_iterators.h:152
Index_lookup *const m_ref
Definition: ref_row_iterators.h:164
const bool m_use_limit
Definition: ref_row_iterators.h:167
const bool m_use_order
Definition: ref_row_iterators.h:166
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:650
Item_func_match *const m_ft_func
Definition: ref_row_iterators.h:165
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:673
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:168
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:595
~FullTextSearchIterator() override
Definition: ref_row_iterators.cc:643
Definition: item_func.h:3465
Read a table assumed to be included in execution of a pushed join.
Definition: ref_row_iterators.h:237
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:276
Index_lookup *const m_ref
Definition: ref_row_iterators.h:247
PushedJoinRefIterator(THD *thd, TABLE *table, Index_lookup *ref, bool use_order, bool is_unique, ha_rows *examined_rows)
Definition: ref_row_iterators.cc:251
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:261
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:251
const bool m_use_order
Definition: ref_row_iterators.h:248
const bool m_is_unique
Definition: ref_row_iterators.h:249
bool m_first_record_since_init
Definition: ref_row_iterators.h:250
Definition: sql_executor.h:254
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:48
RefIterator(THD *thd, TABLE *table, Index_lookup *ref, bool use_order, double expected_rows, ha_rows *examined_rows)
Definition: ref_row_iterators.h:51
bool m_first_record_since_init
Definition: ref_row_iterators.h:68
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:67
Index_lookup *const m_ref
Definition: ref_row_iterators.h:64
bool m_is_mvi_unique_filter_enabled
Definition: ref_row_iterators.h:69
const bool m_use_order
Definition: ref_row_iterators.h:65
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:338
const double m_expected_rows
Definition: ref_row_iterators.h:66
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:76
bool m_reading_first_row
Definition: ref_row_iterators.h:89
const double m_expected_rows
Definition: ref_row_iterators.h:90
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:714
Index_lookup *const m_ref
Definition: ref_row_iterators.h:87
ha_rows *const m_examined_rows
Definition: ref_row_iterators.h:91
const bool m_use_order
Definition: ref_row_iterators.h:88
~RefOrNullIterator() override
Definition: ref_row_iterators.cc:762
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:697
bool m_is_mvi_unique_filter_enabled
Definition: ref_row_iterators.h:92
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:688
A context for reading through a single table using a chosen access method: index read,...
Definition: row_iterator.h:82
THD * thd() const
Definition: row_iterator.h:228
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:36
Definition: row_iterator.h:234
TABLE * table() const
Definition: row_iterator.h:246
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:477
my_off_t ha_rows
Definition: my_base.h:1141
Some integer typedefs for easier portability.
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
PT & ref(PT *tp)
Definition: tablespace_impl.cc:359
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42
Structure used for index-based lookups.
Definition: sql_opt_exec_shared.h:67
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83