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;
258 bool use_order,
bool is_unique,
ha_rows *examined_rows);
260 bool Init()
override;
289 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:280
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:787
std::vector< bool * > m_applicable_cond_guards
Definition: ref_row_iterators.h:304
void UnlockRow() override
Definition: ref_row_iterators.h:299
RowIterator * m_last_iterator_inited
Definition: ref_row_iterators.h:312
int Read() override
Read a single row.
Definition: ref_row_iterators.h:291
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:807
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:293
RowIterator * m_iterator
Definition: ref_row_iterators.h:308
TABLE *const m_table
Definition: ref_row_iterators.h:322
unique_ptr_destroy_only< RowIterator > m_source_iterator
Definition: ref_row_iterators.h:316
MY_BITMAP * m_original_read_set
The original value of table->read_set.
Definition: ref_row_iterators.h:332
MY_BITMAP m_table_scan_read_set
A read set we can use when we fall back to table scans, to get the base columns we need for virtual g...
Definition: ref_row_iterators.h:329
unique_ptr_destroy_only< RowIterator > m_table_scan_iterator
Definition: ref_row_iterators.h:319
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: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:183
MY_BITMAP m_read_set_with_base_columns
Read set to be used when range optimizer picks a non-covering index or when table scan gets picked.
Definition: ref_row_iterators.h:230
MY_BITMAP * m_read_set_without_base_columns
Read set to be used when range optimizer picks covering index.
Definition: ref_row_iterators.h:221
QEP_TAB * m_qep_tab
Definition: ref_row_iterators.h:194
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:495
~DynamicRangeIterator() override
Definition: ref_row_iterators.cc:489
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:605
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: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:246
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: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: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:110
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:668
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:691
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:613
~FullTextSearchIterator() override
Definition: ref_row_iterators.cc:661
Definition: item_func.h:3417
Read a table assumed to be included in execution of a pushed join.
Definition: ref_row_iterators.h:254
int Read() override
Read a single row.
Definition: ref_row_iterators.cc:276
Index_lookup *const m_ref
Definition: ref_row_iterators.h:264
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:268
const bool m_use_order
Definition: ref_row_iterators.h:265
const bool m_is_unique
Definition: ref_row_iterators.h:266
bool m_first_record_since_init
Definition: ref_row_iterators.h:267
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:338
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:732
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:780
bool Init() override
Initialize or reinitialize the iterator.
Definition: ref_row_iterators.cc:715
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:706
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.
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
Definition: my_bitmap.h:42