MySQL 9.1.0
Source Code Documentation
PushedJoinRefIterator Class Referencefinal

Read a table assumed to be included in execution of a pushed join. More...

#include <ref_row_iterators.h>

Inheritance diagram for PushedJoinRefIterator:
[legend]

Public Member Functions

 PushedJoinRefIterator (THD *thd, TABLE *table, Index_lookup *ref, bool use_order, bool is_unique, 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
 
 RowIterator (const RowIterator &)=delete
 
 RowIterator (RowIterator &&)=default
 
virtual const IteratorProfilerGetProfiler () const
 Get profiling data for this iterator (for 'EXPLAIN ANALYZE'). More...
 
virtual void SetOverrideProfiler (const IteratorProfiler *profiler)
 
virtual RowIteratorreal_iterator ()
 If this iterator is wrapping a different iterator (e.g. More...
 
virtual const RowIteratorreal_iterator () const
 

Private Attributes

Index_lookup *const m_ref
 
const bool m_use_order
 
const bool m_is_unique
 
bool m_first_record_since_init
 
ha_rows *const m_examined_rows
 

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

Read a table assumed to be included in execution of a pushed join.

This is the counterpart of RefIterator / EQRefIterator for child tables in a pushed join. As the underlying handler interface for pushed joins are the same for Ref / EQRef operations, we implement both in the same PushedJoinRefIterator class.

In order to differentiate between a 'range' and 'single-row lookup' in the DebugString(), the class takes a 'bool Unique' C'tor argument. This also offers some optimizations in implementation of Read().

When the table access is performed as part of the pushed join, all 'linked' child columns are prefetched together with the parent row. The handler will then only format the row as required by MySQL and set table status accordingly.

However, there may be situations where the prepared pushed join was not executed as assumed. It is the responsibility of the handler to handle these situation by letting ha_index_read_pushed() then effectively do a plain old' index_read_map(..., HA_READ_KEY_EXACT);

Constructor & Destructor Documentation

◆ PushedJoinRefIterator()

PushedJoinRefIterator::PushedJoinRefIterator ( THD thd,
TABLE table,
Index_lookup ref,
bool  use_order,
bool  is_unique,
ha_rows examined_rows 
)

Member Function Documentation

◆ Init()

bool PushedJoinRefIterator::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 Index_lookup) and allow you to read the records anew.

Implements RowIterator.

◆ Read()

int PushedJoinRefIterator::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 PushedJoinRefIterator::m_examined_rows
private

◆ m_first_record_since_init

bool PushedJoinRefIterator::m_first_record_since_init
private

◆ m_is_unique

const bool PushedJoinRefIterator::m_is_unique
private

◆ m_ref

Index_lookup* const PushedJoinRefIterator::m_ref
private

◆ m_use_order

const bool PushedJoinRefIterator::m_use_order
private

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