MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
st_position Struct Reference

#include <sql_select.h>

Inheritance diagram for st_position:
Collaboration diagram for st_position:

Public Member Functions

void no_semijoin ()
void set_prefix_costs (double read_time_arg, double row_count_arg)

Public Attributes

double records_read
double read_time
JOIN_TABtable
Key_usekey
table_map ref_depend_map
bool use_join_buffer
Cost_estimate prefix_cost
double prefix_record_count
uint sj_strategy
uint n_sj_tables
table_map dups_producing_tables
uint first_loosescan_table
table_map loosescan_need_tables
uint loosescan_key
uint loosescan_parts
uint first_firstmatch_table
table_map first_firstmatch_rtbl
table_map firstmatch_need_tables
uint first_dupsweedout_table
table_map dupsweedout_tables
uint sjm_scan_last_inner
table_map sjm_scan_need_tables

Additional Inherited Members

- Static Public Member Functions inherited from Sql_alloc
static void * operator new (size_t size) throw ()
static void * operator new[] (size_t size) throw ()
static void * operator new[] (size_t size, MEM_ROOT *mem_root) throw ()
static void * operator new (size_t size, MEM_ROOT *mem_root) throw ()
static void operator delete (void *ptr, size_t size)
static void operator delete (void *ptr, MEM_ROOT *mem_root)
static void operator delete[] (void *ptr, MEM_ROOT *mem_root)
static void operator delete[] (void *ptr, size_t size)

Detailed Description

A position of table within a join order. This structure is primarily used as a part of join->positions and join->best_positions arrays.

One POSITION element contains information about:

  • Which table is accessed
  • Which access method was chosen = Its cost and #of output records
  • Semi-join strategy choice. Note that there are two different representation formats:
    1. The one used during join optimization
    2. The one used at plan refinement/code generation stage. We call fix_semijoin_strategies_for_picked_join_order() to switch between #1 and #2. See that function's comment for more details.
  • Semi-join optimization state. When we're running join optimization, we main a state for every semi-join strategy which are various variables that tell us if/at which point we could consider applying the strategy. The variables are really a function of join prefix but they are too expensive to re-caclulate for every join prefix we consider, so we maintain current state in join->positions[#tables_in_prefix]. See advance_sj_state() for details.

This class has to stay a POD, because it is memcpy'd in many places.

Definition at line 362 of file sql_select.h.

Member Function Documentation

void st_position::no_semijoin ( )
inline

Even if the query has no semijoin, two sj-related members are read and must thus have been set, by this function.

Definition at line 480 of file sql_select.h.

Member Data Documentation

table_map st_position::dups_producing_tables

Bitmap of semi-join inner tables that are in the join prefix and for which there's no provision yet for how to eliminate semi-join duplicates which they produce.

Definition at line 419 of file sql_select.h.


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