Drizzled Public API Documentation

drizzled::optimizer::Position Class Reference

#include <position.h>

List of all members.

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)
Positionoperator= (const Position &rhs)
bool isConstTable () const
double getFanout () const
void setFanout (double in_records_read)
double getCost () const
JoinTablegetJoinTable ()
bool hasTableForSorting (Table *cmp_table) const
bool examinePosition (table_map found_ref)
KeyUsegetKeyUse ()
table_map getRefDependMap () const
void clearRefDependMap ()

Private Attributes

double records_read
double read_time
JoinTabletable
KeyUsekey
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.


Member Function Documentation

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.

Referenced by drizzled::best_extension_by_limited_search(), and drizzled::optimize_straight_join().

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.

References records_read.

Referenced by drizzled::best_extension_by_limited_search().


Member Data Documentation

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.

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.

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.

Referenced by isConstTable().

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.


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