81
82
enum_nested_loop_state end_send_group(JOIN *join, JoinTable *join_tab, bool end_of_records);
82
83
enum_nested_loop_state end_write_group(JOIN *join, JoinTable *join_tab, bool end_of_records);
85
* Information about a position of table within a join order. Used in join
101
Position(double in_records_read,
105
table_map in_ref_depend_map)
107
records_read(in_records_read),
108
read_time(in_read_time),
111
ref_depend_map(in_ref_depend_map)
115
* Determine whether the table this particular position is representing in
116
* the query plan is a const table or not. A constant table is defined as
117
* (taken from the MySQL optimizer internals document on MySQL forge):
119
* 1) A table with zero rows, or with only one row
120
* 2) A table expression that is restricted with a WHERE condition
122
* Based on the definition above, when records_read is set to 1.0 in the
123
* Position class, it infers that this position in the partial plan
124
* represents a const table.
126
* @return true if this position represents a const table; false otherwise
128
bool isConstTable() const
130
return (records_read < 2.0);
133
double getFanout() const
138
void setFanout(double in_records_read)
140
records_read= in_records_read;
143
double getCost() const
148
JoinTable *getJoinTable()
154
* Check to see if the table attached to the JoinTable for this position
155
* has an index that can produce an ordering.
157
* @return true if the table attached to the JoinTable for this position
158
* does not have an index that can produce an ordering; false otherwise
160
bool hasTableForSorting(Table *cmp_table) const
162
return (cmp_table != table->table);
165
bool examinePosition(table_map found_ref)
167
if (table->table->map & found_ref)
179
table_map getRefDependMap()
181
return ref_depend_map;
184
void clearRefDependMap()
192
The "fanout": number of output rows that will be produced (after
193
pushed down selection condition is applied) per each row combination of
194
previous tables. The value is an in-precise estimate.
199
Cost accessing the table in course of the entire complete join execution,
200
i.e. cost of one access method use (e.g. 'range' or 'ref' scan ) times
201
number the access method will be invoked.
208
NULL - 'index' or 'range' or 'index_merge' or 'ALL' access is used.
209
Other - [eq_]ref[_or_null] access is used. Pointer to {t.keypart1 = expr}
213
/** If ref-based access is used: bitmap of tables this table depends on */
214
table_map ref_depend_map;
218
85
typedef struct st_rollup
220
87
enum State { STATE_NONE, STATE_INITED, STATE_READY };
332
199
bool change_group_ref(Session *session, Item_func *expr, order_st *group_list, bool *changed);
333
200
bool check_interleaving_with_nj(JoinTable *last, JoinTable *next);
335
int join_read_const_table(JoinTable *tab, Position *pos);
202
int join_read_const_table(JoinTable *tab, drizzled::optimizer::Position *pos);
336
203
int join_read_system(JoinTable *tab);
337
204
int join_read_const(JoinTable *tab);
338
205
int join_read_key(JoinTable *tab);