MySQL  8.0.27
Source Code Documentation
IndexRangeScanIterator Class Referencefinal

Scan a given range of the table (a “quick”), using an index. More...

#include <basic_row_iterators.h>

Inheritance diagram for IndexRangeScanIterator:
TableRowIterator RowIterator

Public Member Functions

 IndexRangeScanIterator (THD *thd, TABLE *table, QUICK_SELECT_I *quick, double expected_rows, ha_rows *examined_rows)
 
bool Init () override
 Initialize or reinitialize the iterator. More...
 
int Read () override
 Read a single row. More...
 
- Public Member Functions inherited from TableRowIterator
 TableRowIterator (THD *thd, TABLE *table)
 
void UnlockRow () override
 The default implementation of unlock-row method of RowIterator, used in all access methods except EQRefIterator. More...
 
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 is true, you'll get only NULLs no matter what is actually in the buffer (typically some old leftover row). More...
 
void StartPSIBatchMode () override
 Start performance schema batch mode, if supported (otherwise ignored). More...
 
void EndPSIBatchModeIfStarted () override
 Ends performance schema batch mode, if started. More...
 
- Public Member Functions inherited from RowIterator
 RowIterator (THD *thd)
 
virtual ~RowIterator ()=default
 
virtual std::string TimingString () const
 
virtual RowIteratorreal_iterator ()
 If this iterator is wrapping a different iterator (e.g. More...
 
virtual const RowIteratorreal_iterator () const
 

Private Attributes

QUICK_SELECT_I *const m_quick
 
const double m_expected_rows
 
ha_rows *const m_examined_rows
 
bool m_seen_eof {false}
 

Additional Inherited Members

- Protected Member Functions inherited from TableRowIterator
int HandleError (int error)
 
void PrintError (int error)
 
TABLEtable () const
 
- Protected Member Functions inherited from RowIterator
THDthd () const
 

Detailed Description

Scan a given range of the table (a “quick”), using an index.

IndexRangeScanIterator uses one of the QUICK_SELECT classes in opt_range.cc to perform an index scan. There are loads of functionality hidden in these quick classes. It handles all index scans of various kinds.

TODO: Convert the QUICK_SELECT framework to RowIterator, so that we do not need this adapter.

Constructor & Destructor Documentation

◆ IndexRangeScanIterator()

IndexRangeScanIterator::IndexRangeScanIterator ( THD thd,
TABLE table,
QUICK_SELECT_I quick,
double  expected_rows,
ha_rows examined_rows 
)

Member Function Documentation

◆ Init()

bool IndexRangeScanIterator::Init ( )
overridevirtual

Initialize or reinitialize the iterator.

You must always call Init() before trying a Read() (but Init() does not imply Read()).

You can call Init() multiple times; subsequent calls will rewind the iterator (or reposition it, depending on whether the iterator takes in e.g. a TABLE_REF) and allow you to read the records anew.

Implements RowIterator.

◆ Read()

int IndexRangeScanIterator::Read ( )
overridevirtual

Read a single row.

The row data is not actually returned from the function; it is put in the table's (or tables', in case of a join) record buffer, ie., table->records[0].

Return values
0OK
-1End of records
1Error

Implements RowIterator.

Member Data Documentation

◆ m_examined_rows

ha_rows* const IndexRangeScanIterator::m_examined_rows
private

◆ m_expected_rows

const double IndexRangeScanIterator::m_expected_rows
private

◆ m_quick

QUICK_SELECT_I* const IndexRangeScanIterator::m_quick
private

◆ m_seen_eof

bool IndexRangeScanIterator::m_seen_eof {false}
private

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