MySQL  8.0.27
Source Code Documentation
composite_iterators.h File Reference

A composite row iterator is one that takes in one or more existing iterators and processes their rows in some interesting way. More...

#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "my_alloc.h"
#include "my_base.h"
#include "my_inttypes.h"
#include "my_table_map.h"
#include "sql/join_type.h"
#include "sql/mem_root_array.h"
#include "sql/pack_rows.h"
#include "sql/row_iterator.h"
#include "sql/table.h"
#include "sql_string.h"

Go to the source code of this file.


class  FilterIterator
 An iterator that takes in a stream of rows and passes through only those that meet some criteria (i.e., a condition evaluates to true). More...
class  LimitOffsetIterator
 Handles LIMIT and/or OFFSET; Init() eats the first "offset" rows, and Read() stops as soon as it's seen "limit" rows (including any skipped by offset). More...
class  AggregateIterator
 Handles aggregation (typically used for GROUP BY) for the case where the rows are already properly grouped coming in, ie., all rows that are supposed to be part of the same group are adjacent in the input stream. More...
class  NestedLoopIterator
 A simple nested loop join, taking in two iterators (left/outer and right/inner) and joining them together. More...
class  CacheInvalidatorIterator
 An iterator that helps invalidating caches. More...
class  MaterializeIterator
 Handles materialization; the first call to Init() will scan the given iterator to the end, store the results in a temporary table (optionally with deduplication), and then Read() will allow you to read that table repeatedly without the cost of executing the given subquery many times (unless you ask for rematerialization). More...
struct  MaterializeIterator::QueryBlock
struct  MaterializeIterator::Invalidator
class  StreamingIterator
 StreamingIterator is a minimal version of MaterializeIterator that does not actually materialize; instead, every Read() just forwards the call to the subquery iterator and does the required copying from one set of fields to another. More...
class  TemptableAggregateIterator
 Aggregates unsorted data into a temporary table, using update operations to keep running aggregates. More...
class  MaterializedTableFunctionIterator
 An iterator that wraps a Table_function (e.g. More...
class  WeedoutIterator
 Like semijoin materialization, weedout works on the basic idea that a semijoin is just like an inner join as we long as we can get rid of the duplicates somehow. More...
class  RemoveDuplicatesIterator
 An iterator that removes consecutive rows that are the same according to a set of items (typically the join key), so-called “loose scan” (not to be confused with “loose index scan”, which is a QUICK_SELECT_I). More...
class  RemoveDuplicatesOnIndexIterator
 Much like RemoveDuplicatesIterator, but works on the basis of a given index (or more accurately, its keypart), not an arbitrary list of grouped fields. More...
class  NestedLoopSemiJoinWithDuplicateRemovalIterator
 An iterator that is semantically equivalent to a semijoin NestedLoopIterator immediately followed by a RemoveDuplicatesOnIndexIterator. More...
class  MaterializeInformationSchemaTableIterator
 MaterializeInformationSchemaTableIterator makes sure a given I_S temporary table is materialized (filled out) before we try to scan it. More...
class  AppendIterator
 Takes in two or more iterators and output rows from them sequentially (first all rows from the first one, the all from the second one, etc.). More...

Detailed Description

A composite row iterator is one that takes in one or more existing iterators and processes their rows in some interesting way.

They are usually not bound to a single table or similar, but are the inner (non-leaf) nodes of the iterator execution tree. They consistently own their source iterator, although not its memory (since we never allocate row iterators on the heap–usually on a MEM_ROOT>). This means that in the end, you'll end up with a single root iterator which then owns everything else recursively.

SortingIterator and the two window iterators are also composite iterators, but are defined in their own files.