drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::Join Class Reference
Inheritance diagram for drizzled::Join:
[legend]
Collaboration diagram for drizzled::Join:
[legend]

Public Member Functions

 Join (Session *session_arg, List< Item > &fields_arg, uint64_t select_options_arg, select_result *result_arg)
void reset (Session *session_arg, List< Item > &fields_arg, uint64_t select_options_arg, select_result *result_arg)
int prepare (Item ***rref_pointer_array, TableList *tables, uint32_t wind_num, COND *conds, uint32_t og_num, Order *order, Order *group, Item *having, Select_Lex *select, Select_Lex_Unit *unit)
int optimize ()
int reinit ()
void exec ()
int destroy ()
void restore_tmp ()
bool alloc_func_list ()
bool setup_subquery_materialization ()
bool make_sum_func_list (List< Item > &all_fields, List< Item > &send_fields, bool before_group_by, bool recompute=false)
void set_items_ref_array (Item **ptr)
void init_items_ref_array ()
bool rollup_init ()
bool rollup_make_fields (List< Item > &all_fields, List< Item > &fields, Item_sum ***func)
int rollup_send_data (uint32_t idx)
int rollup_write_data (uint32_t idx, Table *table)
void remove_subq_pushed_predicates (Item **where)
void join_free ()
void cleanup (bool full)
void clear ()
void save_join_tab ()
void init_save_join_tab ()
 Save the original join layout.
bool send_row_on_empty_set ()
bool change_result (select_result *result)
bool is_top_level_join () const
void copyPartialPlanIntoOptimalPlan (uint32_t size)
void cache_const_exprs ()
optimizer::Position & getPosFromOptimalPlan (uint32_t index)
optimizer::Position & getPosFromPartialPlan (uint32_t index)
void setPosInPartialPlan (uint32_t index, optimizer::Position &in_pos)
optimizer::Position * getFirstPosInPartialPlan ()
optimizer::Position * getSpecificPosInPartialPlan (int32_t index)

Public Attributes

JoinTable * join_tab
JoinTable ** best_ref
JoinTable ** map2table
JoinTable * join_tab_save
Table ** table
Table ** all_tables
Table * sort_by_table
uint32_t tables
uint32_t outer_tables
uint32_t const_tables
uint32_t send_group_parts
bool sort_and_group
bool first_record
bool full_join
bool group
bool no_field_update
bool do_send_rows
bool resume_nested_loop
bool no_const_tables
bool select_distinct
bool group_optimized_away
bool simple_order
bool simple_group
bool no_order
bool skip_sort_order
bool union_part
bool optimized
bool need_tmp
bool hidden_group_fields
table_map const_table_map
table_map found_const_table_map
table_map outer_join
ha_rows send_records
ha_rows found_records
ha_rows examined_rows
ha_rows row_limit
ha_rows select_limit
ha_rows fetch_limit
Session * session
List< Item > * fields
List< Item > & fields_list
List< TableList > * join_list
Select_Lex_Unit * unit
Select_Lex * select_lex
optimizer::SqlSelect * select
std::bitset< 64 > cur_embedding_map
double best_read
List< Cached_item > group_fields
List< Cached_item > group_fields_cache
Table * tmp_table
Table * exec_tmp_table1
Table * exec_tmp_table2
Item_sum ** sum_funcs
Item_sum *** sum_funcs_end
Item_sum ** sum_funcs2
Item_sum *** sum_funcs_end2
Item * having
Item * tmp_having
Item * having_history
uint64_t select_options
select_result * result
Tmp_Table_Param tmp_table_param
DrizzleLock * lock
Join * tmp_join
Rollup rollup
DYNAMIC_ARRAY keyuse
Item::cond_result cond_value
Item::cond_result having_value
List< Item > all_fields
List< Item > tmp_all_fields1
List< Item > tmp_all_fields2
List< Item > tmp_all_fields3
List< Item > tmp_fields_list1
List< Item > tmp_fields_list2
List< Item > tmp_fields_list3
int error
Order * order
Order * group_list
COND * conds
Item * conds_history
TableList * tables_list
COND_EQUAL * cond_equal
JoinTable * return_tab
Item ** ref_pointer_array
Item ** items0
Item ** items1
Item ** items2
Item ** items3
Item ** current_ref_pointer_array
uint32_t ref_pointer_array_size
 size of above in bytes
const char * zero_result_cause
 not 0 if exec must return zero result
SortField * sortorder
Table ** table_reexec
JoinTable * join_tab_reexec

Private Attributes

optimizer::Position positions [MAX_TABLES+1]
optimizer::Position best_positions [MAX_TABLES+1]

Additional Inherited Members

Static Public Member Functions inherited from drizzled::memory::SqlAlloc
static void * operator new (size_t size)
static void * operator new[] (size_t size)
static void * operator new (size_t size, Root &root)
static void * operator new[] (size_t size, Root &root)
static void * operator new (size_t size, Root *root)
static void * operator new[] (size_t size, Root *root)
static void operator delete (void *)
static void operator delete[] (void *)
static void operator delete (void *, Root &)
static void operator delete[] (void *, Root &)
static void operator delete (void *, Root *)
static void operator delete[] (void *, Root *)

Detailed Description

Definition at line 40 of file join.h.

Member Function Documentation

◆ copyPartialPlanIntoOptimalPlan()

void drizzled::Join::copyPartialPlanIntoOptimalPlan ( uint32_t size)
inline

Copy the partial query plan into the optimal query plan.

Parameters
[in]sizethe size of the plan which is to be copied

Definition at line 311 of file join.h.

◆ getFirstPosInPartialPlan()

optimizer::Position * drizzled::Join::getFirstPosInPartialPlan ( )
inline
Returns
a pointer to the first position in the partial query plan

Definition at line 350 of file join.h.

◆ getPosFromOptimalPlan()

optimizer::Position & drizzled::Join::getPosFromOptimalPlan ( uint32_t index)
inline
Parameters
[in]indexthe index of the position to retrieve
Returns
a reference to the specified position in the optimal query plan

Definition at line 323 of file join.h.

◆ getPosFromPartialPlan()

optimizer::Position & drizzled::Join::getPosFromPartialPlan ( uint32_t index)
inline
Parameters
[in]indexthe index of the position to retrieve
Returns
a reference to the specified position in the partial query plan

Definition at line 333 of file join.h.

◆ getSpecificPosInPartialPlan()

optimizer::Position * drizzled::Join::getSpecificPosInPartialPlan ( int32_t index)
inline
Parameters
[in]indexthe index of the operator to retrieve from the partial query plan
Returns
a pointer to the position in the partial query plan

Definition at line 360 of file join.h.

◆ init_items_ref_array()

void drizzled::Join::init_items_ref_array ( )
inline

Definition at line 272 of file join.h.

◆ send_row_on_empty_set()

bool drizzled::Join::send_row_on_empty_set ( )
inline

Definition at line 298 of file join.h.

◆ set_items_ref_array()

void drizzled::Join::set_items_ref_array ( Item ** ptr)
inline

Definition at line 267 of file join.h.

◆ setPosInPartialPlan()

void drizzled::Join::setPosInPartialPlan ( uint32_t index,
optimizer::Position & in_pos )
inline
Parameters
[in]indexthe index of the position to set
[in]in_posthe value to set the position to

Definition at line 342 of file join.h.

Member Data Documentation

◆ all_fields

List<Item> drizzled::Join::all_fields

to store all fields that used in query

Definition at line 187 of file join.h.

◆ all_tables

Table** drizzled::Join::all_tables

Definition at line 61 of file join.h.

◆ best_positions

optimizer::Position drizzled::Join::best_positions[MAX_TABLES+1]
private

Contains the optimal query execution plan after cost-based optimization has taken place.

Definition at line 52 of file join.h.

◆ best_read

double drizzled::Join::best_read

The cost for the final query execution plan chosen after optimization has completed. The QEP is stored in the best_positions variable.

Definition at line 162 of file join.h.

◆ best_ref

JoinTable** drizzled::Join::best_ref

Definition at line 56 of file join.h.

◆ cond_equal

COND_EQUAL* drizzled::Join::cond_equal

Definition at line 203 of file join.h.

◆ cond_value

Item::cond_result drizzled::Join::cond_value

Definition at line 185 of file join.h.

◆ conds

COND* drizzled::Join::conds

Definition at line 200 of file join.h.

◆ conds_history

Item* drizzled::Join::conds_history

store WHERE for explain

Definition at line 201 of file join.h.

◆ const_table_map

table_map drizzled::Join::const_table_map

Definition at line 122 of file join.h.

◆ const_tables

uint32_t drizzled::Join::const_tables

Definition at line 71 of file join.h.

◆ cur_embedding_map

std::bitset<64> drizzled::Join::cur_embedding_map

Bitmap of nested joins embedding the position at the end of the current partial join (valid only during join optimizer run).

Definition at line 156 of file join.h.

◆ current_ref_pointer_array

Item** drizzled::Join::current_ref_pointer_array

Definition at line 211 of file join.h.

◆ do_send_rows

bool drizzled::Join::do_send_rows

Definition at line 79 of file join.h.

◆ error

int drizzled::Join::error

Definition at line 196 of file join.h.

◆ examined_rows

ha_rows drizzled::Join::examined_rows

Definition at line 128 of file join.h.

◆ exec_tmp_table1

Table* drizzled::Join::exec_tmp_table1

used to store 2 possible tmp table of SELECT

Definition at line 167 of file join.h.

◆ exec_tmp_table2

Table* drizzled::Join::exec_tmp_table2

Definition at line 168 of file join.h.

◆ fetch_limit

ha_rows drizzled::Join::fetch_limit

Used to fetch no more than given amount of rows per one fetch operation of server side cursor. The value is checked in end_send and end_send_group in fashion, similar to offset_limit_cnt:

  • fetch_limit= HA_POS_ERROR if there is no cursor.
  • when we open a cursor, we set fetch_limit to 0,
  • on each fetch iteration we add num_rows to fetch to fetch_limit

Definition at line 140 of file join.h.

◆ fields

List<Item>* drizzled::Join::fields

Definition at line 143 of file join.h.

◆ fields_list

List<Item>& drizzled::Join::fields_list

hold field list passed to select_query

Definition at line 144 of file join.h.

◆ first_record

bool drizzled::Join::first_record

Definition at line 75 of file join.h.

◆ found_const_table_map

table_map drizzled::Join::found_const_table_map

Definition at line 123 of file join.h.

◆ found_records

ha_rows drizzled::Join::found_records

Definition at line 127 of file join.h.

◆ full_join

bool drizzled::Join::full_join

Definition at line 76 of file join.h.

◆ group

bool drizzled::Join::group

Definition at line 77 of file join.h.

◆ group_fields

List<Cached_item> drizzled::Join::group_fields

Definition at line 163 of file join.h.

◆ group_fields_cache

List<Cached_item> drizzled::Join::group_fields_cache

Definition at line 164 of file join.h.

◆ group_list

Order* drizzled::Join::group_list

hold parameters of select_query

Definition at line 199 of file join.h.

◆ group_optimized_away

bool drizzled::Join::group_optimized_away

If we have the GROUP BY statement in the query, but the group_list was emptied by optimizer, this flag is true. It happens when fields in the GROUP BY are from constant table

Definition at line 101 of file join.h.

◆ having

Item* drizzled::Join::having

Definition at line 174 of file join.h.

◆ having_history

Item* drizzled::Join::having_history

Store having for explain

Definition at line 176 of file join.h.

◆ having_value

Item::cond_result drizzled::Join::having_value

Definition at line 186 of file join.h.

◆ hidden_group_fields

bool drizzled::Join::hidden_group_fields

Definition at line 120 of file join.h.

◆ items0

Item** drizzled::Join::items0

Copy of above to be used with different lists

Definition at line 207 of file join.h.

◆ items1

Item** drizzled::Join::items1

Definition at line 208 of file join.h.

◆ items2

Item** drizzled::Join::items2

Definition at line 209 of file join.h.

◆ items3

Item** drizzled::Join::items3

Definition at line 210 of file join.h.

◆ join_list

List<TableList>* drizzled::Join::join_list

list of joined tables in reverse order

Definition at line 145 of file join.h.

◆ join_tab

JoinTable* drizzled::Join::join_tab

Definition at line 55 of file join.h.

◆ join_tab_reexec

JoinTable* drizzled::Join::join_tab_reexec

Definition at line 224 of file join.h.

◆ join_tab_save

JoinTable* drizzled::Join::join_tab_save

saved join_tab for subquery reexecution

Definition at line 58 of file join.h.

◆ keyuse

DYNAMIC_ARRAY drizzled::Join::keyuse

Definition at line 184 of file join.h.

◆ lock

DrizzleLock* drizzled::Join::lock

Definition at line 180 of file join.h.

◆ map2table

JoinTable** drizzled::Join::map2table

mapping between table indexes and JoinTables

Definition at line 57 of file join.h.

◆ need_tmp

bool drizzled::Join::need_tmp

Definition at line 119 of file join.h.

◆ no_const_tables

bool drizzled::Join::no_const_tables

true <=> optimizer must not mark any table as a constant table. This is needed for subqueries in form "a IN (SELECT .. UNION SELECT ..): when we optimize the select that reads the results of the union from a temporary table, we must not mark the temp. table as constant because the number of rows in it may vary from one subquery execution to another.

Definition at line 92 of file join.h.

◆ no_field_update

bool drizzled::Join::no_field_update

Definition at line 78 of file join.h.

◆ no_order

bool drizzled::Join::no_order

Is set only in case if we have a GROUP BY clause and no ORDER BY after constant elimination of 'order'.

Definition at line 114 of file join.h.

◆ optimized

bool drizzled::Join::optimized

flag to avoid double optimization in EXPLAIN

Definition at line 118 of file join.h.

◆ order

Order* drizzled::Join::order

Definition at line 198 of file join.h.

◆ outer_join

table_map drizzled::Join::outer_join

Definition at line 124 of file join.h.

◆ outer_tables

uint32_t drizzled::Join::outer_tables

Number of tables that are not inside semijoin

Definition at line 70 of file join.h.

◆ positions

optimizer::Position drizzled::Join::positions[MAX_TABLES+1]
private

Contains a partial query execution plan which is extended during cost-based optimization.

Definition at line 46 of file join.h.

◆ ref_pointer_array

Item** drizzled::Join::ref_pointer_array

used pointer reference for this select

Definition at line 205 of file join.h.

◆ ref_pointer_array_size

uint32_t drizzled::Join::ref_pointer_array_size

size of above in bytes

Definition at line 212 of file join.h.

◆ result

select_result* drizzled::Join::result

Definition at line 178 of file join.h.

◆ resume_nested_loop

bool drizzled::Join::resume_nested_loop

true when we want to resume nested loop iterations when fetching data from a cursor

Definition at line 84 of file join.h.

◆ return_tab

JoinTable* drizzled::Join::return_tab

used only for outer joins

Definition at line 204 of file join.h.

◆ rollup

Rollup drizzled::Join::rollup

Used with rollup

Definition at line 183 of file join.h.

◆ row_limit

ha_rows drizzled::Join::row_limit

Definition at line 129 of file join.h.

◆ select

optimizer::SqlSelect* drizzled::Join::select

created in optimization phase

Definition at line 150 of file join.h.

◆ select_distinct

bool drizzled::Join::select_distinct

Set if SELECT DISTINCT

Definition at line 93 of file join.h.

◆ select_lex

Select_Lex* drizzled::Join::select_lex

select that processed

Definition at line 149 of file join.h.

◆ select_limit

ha_rows drizzled::Join::select_limit

Definition at line 130 of file join.h.

◆ select_options

uint64_t drizzled::Join::select_options

Definition at line 177 of file join.h.

◆ send_group_parts

uint32_t drizzled::Join::send_group_parts

Definition at line 72 of file join.h.

◆ send_records

ha_rows drizzled::Join::send_records

Definition at line 126 of file join.h.

◆ session

Session* drizzled::Join::session

Definition at line 142 of file join.h.

◆ simple_group

bool drizzled::Join::simple_group

Definition at line 109 of file join.h.

◆ simple_order

bool drizzled::Join::simple_order

Definition at line 108 of file join.h.

◆ skip_sort_order

bool drizzled::Join::skip_sort_order

Is set if we have a GROUP BY and we have ORDER BY on a constant.

Definition at line 116 of file join.h.

◆ sort_and_group

bool drizzled::Join::sort_and_group

Definition at line 74 of file join.h.

◆ sort_by_table

Table* drizzled::Join::sort_by_table

The table which has an index that allows to produce the requried ordering. A special value of 0x1 means that the ordering will be produced by passing 1st non-const table to filesort(). NULL means no such table exists.

Definition at line 67 of file join.h.

◆ sortorder

SortField* drizzled::Join::sortorder

Definition at line 222 of file join.h.

◆ sum_funcs

Item_sum** drizzled::Join::sum_funcs

Definition at line 169 of file join.h.

◆ sum_funcs2

Item_sum** drizzled::Join::sum_funcs2

second copy of sumfuncs (for queries with 2 temporary tables

Definition at line 172 of file join.h.

◆ sum_funcs_end

Item_sum*** drizzled::Join::sum_funcs_end

Definition at line 170 of file join.h.

◆ sum_funcs_end2

Item_sum*** drizzled::Join::sum_funcs_end2

Definition at line 173 of file join.h.

◆ table

Table** drizzled::Join::table

Definition at line 60 of file join.h.

◆ table_reexec

Table** drizzled::Join::table_reexec

Definition at line 223 of file join.h.

◆ tables

uint32_t drizzled::Join::tables

Number of tables in the join

Definition at line 69 of file join.h.

◆ tables_list

TableList* drizzled::Join::tables_list

hold 'tables' parameter of select_query

Definition at line 202 of file join.h.

◆ tmp_all_fields1

List<Item> drizzled::Join::tmp_all_fields1

Above list changed to use temporary table

Definition at line 189 of file join.h.

◆ tmp_all_fields2

List<Item> drizzled::Join::tmp_all_fields2

Definition at line 190 of file join.h.

◆ tmp_all_fields3

List<Item> drizzled::Join::tmp_all_fields3

Definition at line 191 of file join.h.

◆ tmp_fields_list1

List<Item> drizzled::Join::tmp_fields_list1

Part, shared with list above, emulate following list

Definition at line 193 of file join.h.

◆ tmp_fields_list2

List<Item> drizzled::Join::tmp_fields_list2

Definition at line 194 of file join.h.

◆ tmp_fields_list3

List<Item> drizzled::Join::tmp_fields_list3

Definition at line 195 of file join.h.

◆ tmp_having

Item* drizzled::Join::tmp_having

To store having when processed temporary table

Definition at line 175 of file join.h.

◆ tmp_join

Join* drizzled::Join::tmp_join

copy of this Join to be used with temporary tables

Definition at line 182 of file join.h.

◆ tmp_table

Table* drizzled::Join::tmp_table

Definition at line 165 of file join.h.

◆ tmp_table_param

Tmp_Table_Param drizzled::Join::tmp_table_param

Definition at line 179 of file join.h.

◆ union_part

bool drizzled::Join::union_part

this subselect is part of union

Definition at line 117 of file join.h.

◆ unit

Select_Lex_Unit* drizzled::Join::unit

unit structure (with global parameters) for this select

Definition at line 147 of file join.h.

◆ zero_result_cause

const char* drizzled::Join::zero_result_cause

not 0 if exec must return zero result

Definition at line 213 of file join.h.


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