MySQL 8.0.30
Source Code Documentation
IndexRangeScanIterator Class Reference

#include <index_range_scan.h>

Inheritance diagram for IndexRangeScanIterator:
[legend]

Public Member Functions

 IndexRangeScanIterator (THD *thd, TABLE *table, ha_rows *examined_rows, double expected_rows, uint index_arg, bool need_rows_in_rowid_order, bool reuse_handler, MEM_ROOT *return_mem_root, uint mrr_flags, uint mrr_buf_size, Bounds_checked_array< QUICK_RANGE * > ranges)
 
 ~IndexRangeScanIterator () override
 
 IndexRangeScanIterator (const IndexRangeScanIterator &)=delete
 
 IndexRangeScanIterator (IndexRangeScanIterator &&)=default
 
bool Init () override
 Initialize or reinitialize the iterator. More...
 
int Read () override
 Read a single row. More...
 
void UnlockRow () override
 The default implementation of unlock-row method of RowIterator, used in all access methods except EQRefIterator. More...
 
uint get_mrr_flags () const
 
ucharlast_rowid () const override
 
- Public Member Functions inherited from RowIDCapableRowIterator
 RowIDCapableRowIterator (THD *thd, TABLE *table)
 
- Public Member Functions inherited from TableRowIterator
 TableRowIterator (THD *thd, TABLE *table)
 
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
 
 RowIterator (const RowIterator &)=delete
 
 RowIterator (RowIterator &&)=default
 
virtual const IteratorProfilerGetProfiler () const
 Get profiling data for this iterator (for 'EXPLAIN ANALYZE'). More...
 
virtual void SetOverrideProfiler ([[maybe_unused]] const IteratorProfiler *profiler)
 
virtual RowIteratorreal_iterator ()
 If this iterator is wrapping a different iterator (e.g. More...
 
virtual const RowIteratorreal_iterator () const
 

Protected Attributes

handlerfile
 
uint index
 
bool in_ror_merged_scan
 
MY_BITMAP column_bitmap
 
Bounds_checked_array< QUICK_RANGE * > ranges
 
bool free_file
 
QUICK_RANGE ** cur_range
 
QUICK_RANGElast_range
 
QUICK_RANGE_SEQ_CTX qr_traversal_ctx
 
uint mrr_flags
 
uint mrr_buf_size
 
HANDLER_BUFFERmrr_buf_desc
 
KEY_PART_INFOkey_part_info
 
const bool need_rows_in_rowid_order
 
const bool reuse_handler
 

Private Member Functions

int cmp_next (QUICK_RANGE *range)
 
int cmp_prev (QUICK_RANGE *range)
 
bool row_in_ranges ()
 
bool shared_init ()
 
bool shared_reset ()
 
bool init_ror_merged_scan ()
 

Private Attributes

MEM_ROOTmem_root
 
bool inited = false
 
const bool m_expected_rows
 
ha_rowsm_examined_rows
 

Friends

class IndexMergeIterator
 
class RowIDIntersectionIterator
 
uint quick_range_seq_next (range_seq_t rseq, KEY_MULTI_RANGE *range)
 
range_seq_t quick_range_seq_init (void *init_param, uint n_ranges, uint flags)
 

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
 

Constructor & Destructor Documentation

◆ IndexRangeScanIterator() [1/3]

IndexRangeScanIterator::IndexRangeScanIterator ( THD thd,
TABLE table,
ha_rows examined_rows,
double  expected_rows,
uint  index_arg,
bool  need_rows_in_rowid_order,
bool  reuse_handler,
MEM_ROOT return_mem_root,
uint  mrr_flags,
uint  mrr_buf_size,
Bounds_checked_array< QUICK_RANGE * >  ranges 
)

◆ ~IndexRangeScanIterator()

IndexRangeScanIterator::~IndexRangeScanIterator ( )
override

◆ IndexRangeScanIterator() [2/3]

IndexRangeScanIterator::IndexRangeScanIterator ( const IndexRangeScanIterator )
delete

◆ IndexRangeScanIterator() [3/3]

IndexRangeScanIterator::IndexRangeScanIterator ( IndexRangeScanIterator &&  )
default

Member Function Documentation

◆ cmp_next()

int IndexRangeScanIterator::cmp_next ( QUICK_RANGE range)
private

◆ cmp_prev()

int IndexRangeScanIterator::cmp_prev ( QUICK_RANGE range)
private

◆ get_mrr_flags()

uint IndexRangeScanIterator::get_mrr_flags ( ) const
inline

◆ 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.

◆ init_ror_merged_scan()

bool IndexRangeScanIterator::init_ror_merged_scan ( )
private

◆ last_rowid()

uchar * IndexRangeScanIterator::last_rowid ( ) const
inlineoverridevirtual

◆ 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.

◆ row_in_ranges()

bool IndexRangeScanIterator::row_in_ranges ( )
private

◆ shared_init()

bool IndexRangeScanIterator::shared_init ( )
private

◆ shared_reset()

bool IndexRangeScanIterator::shared_reset ( )
private

◆ UnlockRow()

void IndexRangeScanIterator::UnlockRow ( )
inlineoverridevirtual

The default implementation of unlock-row method of RowIterator, used in all access methods except EQRefIterator.

Reimplemented from TableRowIterator.

Friends And Related Function Documentation

◆ IndexMergeIterator

friend class IndexMergeIterator
friend

◆ quick_range_seq_init

range_seq_t quick_range_seq_init ( void *  init_param,
uint  n_ranges,
uint  flags 
)
friend

◆ quick_range_seq_next

uint quick_range_seq_next ( range_seq_t  rseq,
KEY_MULTI_RANGE range 
)
friend

◆ RowIDIntersectionIterator

friend class RowIDIntersectionIterator
friend

Member Data Documentation

◆ column_bitmap

MY_BITMAP IndexRangeScanIterator::column_bitmap
protected

◆ cur_range

QUICK_RANGE** IndexRangeScanIterator::cur_range
protected

◆ file

handler* IndexRangeScanIterator::file
protected

◆ free_file

bool IndexRangeScanIterator::free_file
protected

◆ in_ror_merged_scan

bool IndexRangeScanIterator::in_ror_merged_scan
protected

◆ index

uint IndexRangeScanIterator::index
protected

◆ inited

bool IndexRangeScanIterator::inited = false
private

◆ key_part_info

KEY_PART_INFO* IndexRangeScanIterator::key_part_info
protected

◆ last_range

QUICK_RANGE* IndexRangeScanIterator::last_range
protected

◆ m_examined_rows

ha_rows* IndexRangeScanIterator::m_examined_rows
private

◆ m_expected_rows

const bool IndexRangeScanIterator::m_expected_rows
private

◆ mem_root

MEM_ROOT* IndexRangeScanIterator::mem_root
private

◆ mrr_buf_desc

HANDLER_BUFFER* IndexRangeScanIterator::mrr_buf_desc
protected

◆ mrr_buf_size

uint IndexRangeScanIterator::mrr_buf_size
protected

◆ mrr_flags

uint IndexRangeScanIterator::mrr_flags
protected

◆ need_rows_in_rowid_order

const bool IndexRangeScanIterator::need_rows_in_rowid_order
protected

◆ qr_traversal_ctx

QUICK_RANGE_SEQ_CTX IndexRangeScanIterator::qr_traversal_ctx
protected

◆ ranges

Bounds_checked_array<QUICK_RANGE *> IndexRangeScanIterator::ranges
protected

◆ reuse_handler

const bool IndexRangeScanIterator::reuse_handler
protected

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