FollowTailIterator is a special version of TableScanIterator that is used as part of WITH RECURSIVE queries.
More...
|
| FollowTailIterator (THD *thd, TABLE *table, double expected_rows, ha_rows *examined_rows) |
|
| ~FollowTailIterator () override |
|
bool | Init () override |
| Initialize or reinitialize the iterator. More...
|
|
int | Read () override |
| Read a single row. More...
|
|
void | set_stored_rows_pointer (ha_rows *stored_rows) |
| Signal where we can expect to find the number of generated rows for this materialization (this points into the MaterializeIterator's data). More...
|
|
bool | RepositionCursorAfterSpillToDisk () |
| Signal to the iterator that the underlying table was closed and replaced with an InnoDB table with the same data, due to a spill-to-disk (e.g. More...
|
|
| 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...
|
|
| RowIterator (THD *thd) |
|
virtual | ~RowIterator ()=default |
|
| RowIterator (const RowIterator &)=delete |
|
| RowIterator (RowIterator &&)=default |
|
virtual const IteratorProfiler * | GetProfiler () const |
| Get profiling data for this iterator (for 'EXPLAIN ANALYZE'). More...
|
|
virtual void | SetOverrideProfiler (const IteratorProfiler *profiler) |
|
virtual RowIterator * | real_iterator () |
| If this iterator is wrapping a different iterator (e.g. More...
|
|
virtual const RowIterator * | real_iterator () const |
|
FollowTailIterator is a special version of TableScanIterator that is used as part of WITH RECURSIVE queries.
It is designed to read from a temporary table at the same time as MaterializeIterator writes to the same table, picking up new records in the order they come in – it follows the tail, much like the UNIX tool “tail -f”.
Furthermore, when materializing a recursive query expression consisting of multiple query blocks, MaterializeIterator needs to run each block several times until convergence. (For a single query block, one iteration suffices, since the iterator sees new records as they come in.) Each such run, the recursive references should see only rows that were added since the last iteration, even though Init() is called anew. FollowTailIterator is thus different from TableScanIterator in that subsequent calls to Init() do not move the cursor back to the start.
In addition, FollowTailIterator implements the WITH RECURSIVE iteration limit. This is not specified in terms of Init() calls, since one run can encompass many iterations. Instead, it keeps track of the number of records in the table at the start of iteration, and when it has read all of those records, the next iteration is deemed to have begun. If the iteration counter is above the user-set limit, it raises an error to stop runaway queries with infinite recursion.