MySQL 8.0.40
Source Code Documentation
ContainedSubquery Struct Reference

This class represents a subquery contained in some subclass of Item_subselect,. More...

#include <item.h>

Public Types

enum class  Strategy : char { kMaterializable , kNonMaterializable , kIndependentSingleRow }
 The strategy for executing the subquery. More...
 

Public Attributes

AccessPathpath
 The root path of the subquery. More...
 
Strategy strategy
 The strategy for executing the subquery. More...
 
int row_width
 The width (in bytes) of the subquery's rows. More...
 

Detailed Description

This class represents a subquery contained in some subclass of Item_subselect,.

See also
FindContainedSubqueries().

Member Enumeration Documentation

◆ Strategy

enum class ContainedSubquery::Strategy : char
strong

The strategy for executing the subquery.

Enumerator
kMaterializable 

An independent subquery that is materialized, e.g.

: "SELECT * FROM tab WHERE field IN <independent subquery>". where 'independent subquery' does not depend on any fields in 'tab'. (This corresponds to the Item_in_subselect class.)

kNonMaterializable 

A subquery that is reevaluated for each row, e.g.

: "SELECT * FROM tab WHERE field IN <dependent subquery>" or "SELECT * FROM tab WHERE field = <dependent subquery>". where 'dependent subquery' depends on at least one field in 'tab'. Alternatively, the subquery may be independent of 'tab', but contain a non-deterministic function such as 'rand()'. Such subqueries are also required to be reevaluated for each row.

kIndependentSingleRow 

An independent single-row subquery that is evaluated once, e.g.

: "SELECT * FROM tab WHERE field = <independent single-row subquery>". (This corresponds to the Item_singlerow_subselect class.)

Member Data Documentation

◆ path

AccessPath* ContainedSubquery::path

The root path of the subquery.

◆ row_width

int ContainedSubquery::row_width

The width (in bytes) of the subquery's rows.

For variable-sized values we use Item.max_length (but cap it at kMaxItemLengthEstimate).

See also
kMaxItemLengthEstimate and
Item_in_subselect::get_contained_subquery().

◆ strategy

Strategy ContainedSubquery::strategy

The strategy for executing the subquery.


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