MySQL 8.0.39
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/iterators/row_iterator.h"
#include "sql/join_type.h"
#include "sql/mem_root_array.h"
#include "sql/pack_rows.h"
#include "sql/table.h"
#include "sql_string.h"

Go to the source code of this file.

Classes

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...
 
struct  materialize_iterator::QueryBlock
 A query block to be materialized by MaterializeIterator. More...
 
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  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 made by the range optimizer). 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...
 

Namespaces

namespace  materialize_iterator
 
namespace  temptable_aggregate_iterator
 

Functions

RowIteratormaterialize_iterator::CreateIterator (THD *thd, Mem_root_array< materialize_iterator::QueryBlock > query_blocks_to_materialize, const MaterializePathParameters *path_params, unique_ptr_destroy_only< RowIterator > table_iterator, JOIN *join)
 Create an iterator that materializes a set of row into a temporary table and sets up a (pre-existing) iterator to access that. More...
 
RowIteratortemptable_aggregate_iterator::CreateIterator (THD *thd, unique_ptr_destroy_only< RowIterator > subquery_iterator, Temp_table_param *temp_table_param, TABLE *table, unique_ptr_destroy_only< RowIterator > table_iterator, JOIN *join, int ref_slice)
 Create an iterator that aggregates the output rows from another iterator into a temporary table and then sets up a (pre-existing) iterator to access the temporary table. 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.