MySQL  8.0.20
Source Code Documentation
AQP::Table_access Class Reference

This class represents an access operation on a table, such as a table scan, or a scan or lookup via an index. More...

#include <abstract_query_plan.h>

Public Member Functions

const Join_planget_join_plan () const
 Get the Join_plan that this Table_access belongs to. More...
 
enum_access_type get_access_type () const
 Get the type of this operation. More...
 
const char * get_other_access_reason () const
 Get a description of the reason for getting access_type==AT_OTHER. More...
 
uint get_no_of_key_fields () const
 Get the number of key values for this operation. More...
 
const Itemget_key_field (uint field_no) const
 Get the field_no'th key values for this operation. More...
 
const KEY_PART_INFOget_key_part_info (uint field_no) const
 Get the field_no'th KEY_PART_INFO for this operation. More...
 
uint get_access_no () const
 Get the number of this Table_access within the enclosing Join_plan. More...
 
int get_index_no () const
 
TABLEget_table () const
 Get the table that this operation accesses. More...
 
Item_equalget_item_equal (const Item_field *field_item) const
 Get the Item_equal's set relevant for the specified 'Item_field'. More...
 
void dbug_print () const
 Write an entry in the trace file about the contents of this object. More...
 
bool uses_join_cache () const
 Check if the results from this operation will joined with results from the next operation using a join buffer (instead of plain nested loop). More...
 
bool filesort_before_join () const
 Check if this table will be presorted to an intermediate record storage before it is joined with its siblings. More...
 
Itemget_condition () const
 
void set_condition (Item *cond)
 
uint get_first_inner () const
 Returns the first/last table in the join-nest this table is a member of. More...
 
uint get_last_inner () const
 
int get_first_upper () const
 
int get_first_sj_inner () const
 Returns the first/last table in a semi-join nest. More...
 
int get_last_sj_inner () const
 
bool is_sj_firstmatch () const
 
int get_firstmatch_return () const
 
uint get_table_properties () const
 Getter and setters for an opaque object for each table. More...
 
void set_table_properties (uint)
 

Private Member Functions

 Table_access ()
 
const QEP_TABget_qep_tab () const
 Get the QEP_TAB object that corresponds to this operation. More...
 
void compute_type_and_index () const
 Compute the access type and index (if apliccable) of this operation . More...
 
 Table_access (const Table_access &)
 No copying. More...
 
Table_accessoperator= (const Table_access &)
 

Private Attributes

const Join_planm_join_plan
 Backref. More...
 
uint m_tab_no
 This operation corresponds to m_root_tab[m_tab_no]. More...
 
enum_access_type m_access_type
 The type of this operation. More...
 
const char * m_other_access_reason
 The reason for getting m_access_type==AT_OTHER. More...
 
int m_index_no
 The index to use for this operation (if applicable ) More...
 
uint m_properties
 May store an opaque property / flag. More...
 

Friends

class Join_plan
 
bool equal (const Table_access *, const Table_access *)
 

Detailed Description

This class represents an access operation on a table, such as a table scan, or a scan or lookup via an index.

A Table_access object is always owned by a Join_plan object, such that the life time of the Table_access object ends when the life time of the owning Join_plan object ends.

Constructor & Destructor Documentation

◆ Table_access() [1/2]

AQP::Table_access::Table_access ( )
explicitprivate

◆ Table_access() [2/2]

AQP::Table_access::Table_access ( const Table_access )
private

No copying.

Member Function Documentation

◆ compute_type_and_index()

void AQP::Table_access::compute_type_and_index ( ) const
private

Compute the access type and index (if apliccable) of this operation .

QUICK_SELECT results in execution of MRR (Multi Range Read). Depending on each range, it may require execution of either a PK-lookup or a range scan. To cover both of these we may need to prepare both a pushed lookup join and a pushed range scan. Currently we handle it as a range scan and convert e PK lookup to a (closed-) range whenever required.

◆ dbug_print()

void AQP::Table_access::dbug_print ( ) const

Write an entry in the trace file about the contents of this object.

◆ filesort_before_join()

bool AQP::Table_access::filesort_before_join ( ) const

Check if this table will be presorted to an intermediate record storage before it is joined with its siblings.

◆ get_access_no()

uint AQP::Table_access::get_access_no ( ) const
inline

Get the number of this Table_access within the enclosing Join_plan.

(This number will be in the range 0 to Join_plan::get_access_count() - 1.)

◆ get_access_type()

enum_access_type AQP::Table_access::get_access_type ( ) const
inline

Get the type of this operation.

◆ get_condition()

Item * AQP::Table_access::get_condition ( ) const

◆ get_first_inner()

uint AQP::Table_access::get_first_inner ( ) const

Returns the first/last table in the join-nest this table is a member of.

As opposed to the nest info returned by the QEP_TAB interface, we enumerate the uppermost nest to range from [0..tables-1] (not [-1,-1]).

Similarly, the first_upper reference to this range is '0', instead of -1. Note, that first_upper of the uppermost nest is still negative.

◆ get_first_sj_inner()

int AQP::Table_access::get_first_sj_inner ( ) const

Returns the first/last table in a semi-join nest.

Returns <0 if table is not part of a semi-join nest.

◆ get_first_upper()

int AQP::Table_access::get_first_upper ( ) const

◆ get_firstmatch_return()

int AQP::Table_access::get_firstmatch_return ( ) const

◆ get_index_no()

int AQP::Table_access::get_index_no ( ) const
inline
Returns
The number of the index to use for this access operation ( or -1 for non-index operations).

◆ get_item_equal()

Item_equal * AQP::Table_access::get_item_equal ( const Item_field field_item) const

Get the Item_equal's set relevant for the specified 'Item_field'.

◆ get_join_plan()

const Join_plan * AQP::Table_access::get_join_plan ( ) const
inline

Get the Join_plan that this Table_access belongs to.

◆ get_key_field()

const Item * AQP::Table_access::get_key_field ( uint  field_no) const

Get the field_no'th key values for this operation.

It is an error to call this method on an operation that is not an index lookup operation.

◆ get_key_part_info()

const KEY_PART_INFO * AQP::Table_access::get_key_part_info ( uint  field_no) const

Get the field_no'th KEY_PART_INFO for this operation.

It is an error to call this method on an operation that is not an index lookup operation.

◆ get_last_inner()

uint AQP::Table_access::get_last_inner ( ) const

◆ get_last_sj_inner()

int AQP::Table_access::get_last_sj_inner ( ) const

◆ get_no_of_key_fields()

uint AQP::Table_access::get_no_of_key_fields ( ) const

Get the number of key values for this operation.

It is an error to call this method on an operation that is not an index lookup operation.

◆ get_other_access_reason()

const char * AQP::Table_access::get_other_access_reason ( ) const
inline

Get a description of the reason for getting access_type==AT_OTHER.

To be used for informational messages.

Returns
A string that should be assumed to have the same life time as the Table_access object.

◆ get_qep_tab()

const QEP_TAB * AQP::Table_access::get_qep_tab ( ) const
private

Get the QEP_TAB object that corresponds to this operation.

◆ get_table()

TABLE * AQP::Table_access::get_table ( ) const

Get the table that this operation accesses.

◆ get_table_properties()

uint AQP::Table_access::get_table_properties ( ) const
inline

Getter and setters for an opaque object for each table.

Used by the handler's to persist 'pushability-flags' to avoid overhead by recalculating it for each engine_push()

◆ is_sj_firstmatch()

bool AQP::Table_access::is_sj_firstmatch ( ) const

◆ operator=()

Table_access& AQP::Table_access::operator= ( const Table_access )
private

◆ set_condition()

void AQP::Table_access::set_condition ( Item cond)

◆ set_table_properties()

void AQP::Table_access::set_table_properties ( uint  val)
inline

◆ uses_join_cache()

bool AQP::Table_access::uses_join_cache ( ) const

Check if the results from this operation will joined with results from the next operation using a join buffer (instead of plain nested loop).

Returns
True if using a join buffer.

Friends And Related Function Documentation

◆ equal

bool equal ( const Table_access ,
const Table_access  
)
friend

◆ Join_plan

friend class Join_plan
friend

Member Data Documentation

◆ m_access_type

enum_access_type AQP::Table_access::m_access_type
mutableprivate

The type of this operation.

◆ m_index_no

int AQP::Table_access::m_index_no
mutableprivate

The index to use for this operation (if applicable )

◆ m_join_plan

const Join_plan* AQP::Table_access::m_join_plan
private

Backref.

to the Join_plan which this Table_access is part of

◆ m_other_access_reason

const char* AQP::Table_access::m_other_access_reason
mutableprivate

The reason for getting m_access_type==AT_OTHER.

Used for explain extended.

◆ m_properties

uint AQP::Table_access::m_properties
private

May store an opaque property / flag.

◆ m_tab_no

uint AQP::Table_access::m_tab_no
private

This operation corresponds to m_root_tab[m_tab_no].


The documentation for this class was generated from the following files: