MySQL 8.0.39
Source Code Documentation
materialize_iterator::QueryBlock Struct Reference

A query block to be materialized by MaterializeIterator. More...

#include <composite_iterators.h>

Public Attributes

unique_ptr_destroy_only< RowIteratorsubquery_iterator
 The iterator to read the actual rows from. More...
 
int select_number
 Used only for optimizer trace. More...
 
JOINjoin
 The JOIN that this query block represents. More...
 
bool disable_deduplication_by_hash_field = false
 If true, unique constraint checking via hash key is disabled when materializing this query block (ie., we simply avoid calling check_unique_constraint() for each row). More...
 
bool copy_items
 If set to false, the Field objects in the output row are presumed already to be filled out. More...
 
ulonglong m_total_operands {0}
 The number of operands (i.e. More...
 
ulonglong m_operand_idx {0}
 The current operand (i.e. More...
 
uint m_first_distinct {0}
 Used for EXCEPT computation: the index of the first operand involved in a N-ary except operation which has DISTINCT. More...
 
Temp_table_paramtemp_table_param
 If copy_items is true, used for copying the Field objects into the temporary table row. More...
 
bool is_recursive_reference = false
 
FollowTailIteratorrecursive_reader = nullptr
 

Detailed Description

A query block to be materialized by MaterializeIterator.

(

See also
MaterializeIterator for details.)

Member Data Documentation

◆ copy_items

bool materialize_iterator::QueryBlock::copy_items

If set to false, the Field objects in the output row are presumed already to be filled out.

This is the case iff there's a windowing iterator earlier in the chain.

◆ disable_deduplication_by_hash_field

bool materialize_iterator::QueryBlock::disable_deduplication_by_hash_field = false

If true, unique constraint checking via hash key is disabled when materializing this query block (ie., we simply avoid calling check_unique_constraint() for each row).

Used when materializing UNION DISTINCT and UNION ALL parts into the same table. We'd like to just use a unique constraint via unique index instead, but there might be other indexes on the destination table that we'd like to keep, and the implementation doesn't allow disabling only one index.

If you use this on a query block, doing_hash_deduplication() must be true.

◆ is_recursive_reference

bool materialize_iterator::QueryBlock::is_recursive_reference = false

◆ join

JOIN* materialize_iterator::QueryBlock::join

The JOIN that this query block represents.

Used for performance schema batch mode: When materializing a query block that consists of a single table, MaterializeIterator needs to set up schema batch mode, since there is no nested loop iterator to do it. (This is similar to what ExecuteIteratorQuery() needs to do at the top level.)

◆ m_first_distinct

uint materialize_iterator::QueryBlock::m_first_distinct {0}

Used for EXCEPT computation: the index of the first operand involved in a N-ary except operation which has DISTINCT.

This is significant for calculating whether to set the counter to zero or just decrement it when we see a right side operand.

◆ m_operand_idx

ulonglong materialize_iterator::QueryBlock::m_operand_idx {0}

The current operand (i.e.

block) number, starting at zero. We use this for INTERSECT and EXCEPT materialization operand.

◆ m_total_operands

ulonglong materialize_iterator::QueryBlock::m_total_operands {0}

The number of operands (i.e.

blocks) involved in the set operation: used for INTERSECT to determine if a value is present in all operands

◆ recursive_reader

FollowTailIterator* materialize_iterator::QueryBlock::recursive_reader = nullptr

◆ select_number

int materialize_iterator::QueryBlock::select_number

Used only for optimizer trace.

◆ subquery_iterator

unique_ptr_destroy_only<RowIterator> materialize_iterator::QueryBlock::subquery_iterator

The iterator to read the actual rows from.

◆ temp_table_param

Temp_table_param* materialize_iterator::QueryBlock::temp_table_param

If copy_items is true, used for copying the Field objects into the temporary table row.

Otherwise unused.


The documentation for this struct was generated from the following file: