MySQL  8.0.17
Source Code Documentation
AQP Namespace Reference

Abstract query plan (AQP) is an interface for examining certain aspects of query plans without accessing mysqld internal classes (JOIN_TAB, QEP_TAB, etc.) directly. More...

Classes

class  Equal_set_iterator
 This class is an iterator for iterating over sets of fields (columns) that should have the same value. More...
 
class  Join_plan
 This class represents a query plan for an n-way join, in the form a sequence of n table access operations that will execute as a nested loop join. More...
 
class  Table_access
 This class represents an access operation on a table, such as a table scan, or a scan or lookup via an index. More...
 

Enumerations

enum  enum_access_type {
  AT_VOID, AT_FIXED, AT_PRIMARY_KEY, AT_UNIQUE_KEY,
  AT_ORDERED_INDEX_SCAN, AT_MULTI_PRIMARY_KEY, AT_MULTI_UNIQUE_KEY, AT_MULTI_MIXED,
  AT_TABLE_SCAN, AT_UNDECIDED, AT_OTHER
}
 The type of a table access operation. More...
 
enum  enum_join_type { JT_OUTER_JOIN, JT_INNER_JOIN, JT_SEMI_JOIN, JT_NEST_JOIN }
 The type of join operation require. More...
 

Detailed Description

Abstract query plan (AQP) is an interface for examining certain aspects of query plans without accessing mysqld internal classes (JOIN_TAB, QEP_TAB, etc.) directly.

AQP maps join execution plans, as represented by mysqld internals, to a set of facade classes. Non-join operations such as sorting and aggregation is currently not modelled in the AQP.

The AQP models an n-way join as a sequence of the n table access operations that the MySQL server would execute as part of its nested loop join execution. (Each such table access operation is a scan of a table or index, or an index lookup.) For each lookup operation, it is possible to examine the expression that represents each field in the key.

A storage enging will typically use the AQP for finding sections of a join execution plan that may be executed in the engine rather than in mysqld. By using the AQP rather than the mysqld internals directly, the coupling between the engine and mysqld is reduced.

The AQP also provides functions which allows the storage engine to change the query execution plan for the part of the join which it will handle. Thus be aware that although the QEP_TAB*'s are const they may be modified.

Enumeration Type Documentation

◆ enum_access_type

The type of a table access operation.

Enumerator
AT_VOID 

For default initialization.

AT_FIXED 

Value has already been fetched / determined by optimizer.

AT_PRIMARY_KEY 

Do a lookup of a single primary key.

AT_UNIQUE_KEY 

Do a lookup of a single unique index key.

AT_ORDERED_INDEX_SCAN 

Scan an ordered index with a single upper and lower bound pair.

AT_MULTI_PRIMARY_KEY 

Do a multi range read for a set of primary keys.

AT_MULTI_UNIQUE_KEY 

Do a multi range read for a set of unique index keys.

AT_MULTI_MIXED 

Do a multi range read for a mix of ranges (for which there is an ordered index), and either primary keys or unique index keys.

AT_TABLE_SCAN 

Scan a table.

(No index is assumed to be used.)

AT_UNDECIDED 

Access method will not be chosen before the execution phase.

AT_OTHER 

The access method has properties that prevents it from being pushed to a storage engine.

◆ enum_join_type

The type of join operation require.

Enumerator
JT_OUTER_JOIN 
JT_INNER_JOIN 
JT_SEMI_JOIN 
JT_NEST_JOIN