drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::optimizer::Position Class Reference

#include <position.h>

Collaboration diagram for drizzled::optimizer::Position:
[legend]

Public Member Functions

 Position (double in_records_read, double in_read_time, JoinTable *in_table, KeyUse *in_key, table_map in_ref_depend_map)
 Position (const Position &rhs)
Position & operator= (const Position &rhs)
bool isConstTable () const
double getFanout () const
void setFanout (double in_records_read)
double getCost () const
JoinTable * getJoinTable ()
bool hasTableForSorting (Table *cmp_table) const
bool examinePosition (table_map found_ref)
KeyUse * getKeyUse ()
table_map getRefDependMap () const
void clearRefDependMap ()

Private Attributes

double records_read
double read_time
JoinTable * table
KeyUse * key
table_map ref_depend_map

Detailed Description

Information about a position of table within a join order. Used in join optimization.

Definition at line 33 of file position.h.

Constructor & Destructor Documentation

◆ Position() [1/3]

drizzled::optimizer::Position::Position ( )
inline

Definition at line 37 of file position.h.

◆ Position() [2/3]

drizzled::optimizer::Position::Position ( double in_records_read,
double in_read_time,
JoinTable * in_table,
KeyUse * in_key,
table_map in_ref_depend_map )
inline

Definition at line 46 of file position.h.

◆ Position() [3/3]

drizzled::optimizer::Position::Position ( const Position & rhs)
inline

Definition at line 59 of file position.h.

Member Function Documentation

◆ clearRefDependMap()

void drizzled::optimizer::Position::clearRefDependMap ( )
inline

Definition at line 145 of file position.h.

◆ examinePosition()

bool drizzled::optimizer::Position::examinePosition ( table_map found_ref)

Definition at line 30 of file position.cc.

◆ getCost()

double drizzled::optimizer::Position::getCost ( ) const
inline

Definition at line 111 of file position.h.

◆ getFanout()

double drizzled::optimizer::Position::getFanout ( ) const
inline

Definition at line 101 of file position.h.

◆ getJoinTable()

JoinTable * drizzled::optimizer::Position::getJoinTable ( )
inline

Definition at line 116 of file position.h.

◆ getKeyUse()

KeyUse * drizzled::optimizer::Position::getKeyUse ( )
inline

Definition at line 135 of file position.h.

◆ getRefDependMap()

table_map drizzled::optimizer::Position::getRefDependMap ( ) const
inline

Definition at line 140 of file position.h.

◆ hasTableForSorting()

bool drizzled::optimizer::Position::hasTableForSorting ( Table * cmp_table) const
inline

Check to see if the table attached to the JoinTable for this position has an index that can produce an ordering.

Returns
true if the table attached to the JoinTable for this position does not have an index that can produce an ordering; false otherwise

Definition at line 128 of file position.h.

◆ isConstTable()

bool drizzled::optimizer::Position::isConstTable ( ) const
inline

Determine whether the table this particular position is representing in the query plan is a const table or not. A constant table is defined as (taken from the MySQL optimizer internals document on MySQL forge):

1) A table with zero rows, or with only one row 2) A table expression that is restricted with a WHERE condition

Based on the definition above, when records_read is set to 1.0 in the Position class, it infers that this position in the partial plan represents a const table.

Returns
true if this position represents a const table; false otherwise

Definition at line 96 of file position.h.

◆ operator=()

Position & drizzled::optimizer::Position::operator= ( const Position & rhs)
inline

Definition at line 68 of file position.h.

◆ setFanout()

void drizzled::optimizer::Position::setFanout ( double in_records_read)
inline

Definition at line 106 of file position.h.

Member Data Documentation

◆ key

KeyUse* drizzled::optimizer::Position::key
private

NULL - 'index' or 'range' or 'index_merge' or 'ALL' access is used. Other - [eq_]ref[_or_null] access is used. Pointer to {t.keypart1 = expr}

Definition at line 172 of file position.h.

◆ read_time

double drizzled::optimizer::Position::read_time
private

Cost accessing the table in course of the entire complete join execution, i.e. cost of one access method use (e.g. 'range' or 'ref' scan ) times number the access method will be invoked.

Definition at line 164 of file position.h.

◆ records_read

double drizzled::optimizer::Position::records_read
private

The "fanout": number of output rows that will be produced (after pushed down selection condition is applied) per each row combination of previous tables. The value is an in-precise estimate.

Definition at line 157 of file position.h.

◆ ref_depend_map

table_map drizzled::optimizer::Position::ref_depend_map
private

If ref-based access is used: bitmap of tables this table depends on

Definition at line 175 of file position.h.

◆ table

JoinTable* drizzled::optimizer::Position::table
private

Definition at line 166 of file position.h.


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