17
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
20
/* classes to use when handling where clause */
23
22
#ifndef DRIZZLED_OPT_RANGE_H
24
23
#define DRIZZLED_OPT_RANGE_H
26
#ifdef USE_PRAGMA_INTERFACE
27
#pragma interface /* gcc class implementation */
30
typedef struct st_key_part {
25
#include <drizzled/field.h>
26
#include <drizzled/item/sum.h>
30
typedef class Item COND;
32
typedef struct st_handler_buffer HANDLER_BUFFER;
34
typedef struct st_key_part
32
38
/* See KEY_PART_INFO for meaning of the next two: */
33
uint16_t store_length, length;
39
uint16_t store_length;
36
43
Keypart flags (0 when this structure is used by partition pruning code
37
44
for fake partitioning index description)
41
Field::imagetype image_type;
45
class QUICK_RANGE :public Sql_alloc {
47
unsigned char *min_key,*max_key;
48
uint16_t min_length,max_length,flag;
49
key_part_map min_keypart_map, // bitmap of used keyparts in min_key
50
max_keypart_map; // bitmap of used keyparts in max_key
50
class QUICK_RANGE :public Sql_alloc
53
unsigned char *min_key;
54
unsigned char *max_key;
58
key_part_map min_keypart_map; /**< bitmap of used keyparts in min_key */
59
key_part_map max_keypart_map; /**< bitmap of used keyparts in max_key */
52
61
uint16_t dummy; /* Avoid warnings on 'flag' */
54
QUICK_RANGE(); /* Full range */
55
QUICK_RANGE(const unsigned char *min_key_arg, uint32_t min_length_arg,
63
QUICK_RANGE(); /**< Constructor for a "full range" */
64
QUICK_RANGE(const unsigned char *min_key_arg,
65
uint32_t min_length_arg,
56
66
key_part_map min_keypart_map_arg,
57
const unsigned char *max_key_arg, uint32_t max_length_arg,
67
const unsigned char *max_key_arg,
68
uint32_t max_length_arg,
58
69
key_part_map max_keypart_map_arg,
60
: min_key((unsigned char*) sql_memdup(min_key_arg,min_length_arg+1)),
72
min_key((unsigned char*) sql_memdup(min_key_arg,min_length_arg+1)),
61
73
max_key((unsigned char*) sql_memdup(max_key_arg,max_length_arg+1)),
62
74
min_length((uint16_t) min_length_arg),
63
75
max_length((uint16_t) max_length_arg),
118
128
class QUICK_SELECT_I
122
ha_rows records; /* estimate of # of records to be retrieved */
123
double read_time; /* time to perform this retrieval */
132
ha_rows records; /**< estimate of # of records to be retrieved */
133
double read_time; /**< time to perform this retrieval */
126
136
Index this quick select uses, or MAX_KEY for quick selects
127
137
that use several indexes
132
141
Total length of first used_key_parts parts of the key.
133
142
Applicable if index!= MAX_KEY.
135
144
uint32_t max_used_key_length;
138
Max. number of (first) key parts this quick select uses for retrieval.
146
Maximum number of (first) key parts this quick select uses for retrieval.
139
147
eg. for "(key1p1=c1 AND key1p2=c2) OR key1p1=c2" used_key_parts == 2.
140
148
Applicable if index!= MAX_KEY.
142
150
For QUICK_GROUP_MIN_MAX_SELECT it includes MIN/MAX argument keyparts.
144
152
uint32_t used_key_parts;
154
* The rowid of last row retrieved by this quick select. This is used only when
155
* doing ROR-index_merge selects
157
unsigned char *last_rowid;
160
* Table record buffer used by this quick select.
162
unsigned char *record;
146
164
QUICK_SELECT_I();
147
165
virtual ~QUICK_SELECT_I(){};
150
Do post-constructor initialization.
154
init() performs initializations that should have been in constructor if
155
it was possible to return errors from constructors. The join optimizer may
156
create and then delete quick selects without retrieving any rows so init()
157
must not contain any IO or CPU intensive code.
159
If init() call fails the only valid action is to delete this quick select,
160
reset() and get_next() must not be called.
166
virtual int init() = 0;
169
Initialize quick select for row retrieval.
173
reset() should be called when it is certain that row retrieval will be
174
necessary. This call may do heavyweight initialization like buffering first
175
N records etc. If reset() call fails get_next() must not be called.
176
Note that reset() may be called several times if
177
* the quick select is executed in a subselect
178
* a JOIN buffer is used
184
virtual int reset(void) = 0;
186
virtual int get_next() = 0; /* get next record to retrieve */
188
/* Range end should be called when we have looped over the whole index */
168
* Do post-constructor initialization.
172
* Performs initializations that should have been in constructor if
173
* it was possible to return errors from constructors. The join optimizer may
174
* create and then delete quick selects without retrieving any rows so init()
175
* must not contain any IO or CPU intensive code.
177
* If init() call fails the only valid action is to delete this quick select,
178
* reset() and get_next() must not be called.
185
virtual int init() = 0;
188
* Initializes quick select for row retrieval.
192
* Should be called when it is certain that row retrieval will be
193
* necessary. This call may do heavyweight initialization like buffering first
194
* N records etc. If reset() call fails get_next() must not be called.
195
* Note that reset() may be called several times if
196
* - the quick select is executed in a subselect
197
* - a JOIN buffer is used
204
virtual int reset(void) = 0;
205
/** Gets next record to retrieve */
206
virtual int get_next() = 0;
208
/** Range end should be called when we have looped over the whole index */
189
209
virtual void range_end() {}
191
211
virtual bool reverse_sorted() = 0;
192
virtual bool unique_key_range() { return false; }
212
virtual bool unique_key_range()
196
QS_TYPE_INDEX_MERGE = 1,
197
QS_TYPE_RANGE_DESC = 2,
198
QS_TYPE_ROR_INTERSECT = 4,
199
QS_TYPE_ROR_UNION = 5,
200
QS_TYPE_GROUP_MIN_MAX = 6
220
QS_TYPE_INDEX_MERGE= 1,
221
QS_TYPE_RANGE_DESC= 2,
222
QS_TYPE_ROR_INTERSECT= 4,
223
QS_TYPE_ROR_UNION= 5,
224
QS_TYPE_GROUP_MIN_MAX= 6
203
/* Get type of this quick select - one of the QS_TYPE_* values */
227
/** Returns the type of this quick select - one of the QS_TYPE_* values */
204
228
virtual int get_type() = 0;
207
Initialize this quick select as a merged scan inside a ROR-union or a ROR-
208
intersection scan. The caller must not additionally call init() if this
211
init_ror_merged_scan()
212
reuse_handler If true, the quick select may use table->handler,
213
otherwise it must create and use a separate handler
219
virtual int init_ror_merged_scan(bool reuse_handler __attribute__((unused)))
220
{ assert(0); return 1; }
231
* Initialize this quick select as a merged scan inside a ROR-union or a ROR-
232
* intersection scan. The caller must not additionally call init() if this
233
* function is called.
235
* @param If true, the quick select may use table->handler,
236
* otherwise it must create and use a separate handler
244
virtual int init_ror_merged_scan(bool)
223
Save ROWID of last retrieved row in file->ref. This used in ROR-merging.
251
* Save ROWID of last retrieved row in file->ref. This used in ROR-merging.
225
253
virtual void save_last_pos(){};
228
Append comma-separated list of keys this quick select uses to key_names;
229
append comma-separated list of corresponding used lengths to used_lengths.
230
This is used by select_describe.
232
virtual void add_keys_and_lengths(String *key_names,
233
String *used_lengths)=0;
236
Append text representation of quick select structure (what and how is
237
merged) to str. The result is added to "Extra" field in EXPLAIN output.
238
This function is implemented only by quick selects that merge other quick
239
selects output and/or can produce output suitable for merging.
241
virtual void add_info_string(String *str __attribute__((unused))) {};
243
Return 1 if any index used by this quick select
244
uses field which is marked in passed bitmap.
246
virtual bool is_keys_used(const MY_BITMAP *fields);
249
rowid of last row retrieved by this quick select. This is used only when
250
doing ROR-index_merge selects
252
unsigned char *last_rowid;
255
Table record buffer used by this quick select.
257
unsigned char *record;
256
* Append comma-separated list of keys this quick select uses to key_names;
257
* append comma-separated list of corresponding used lengths to used_lengths.
259
* @note This is used by select_describe.
261
virtual void add_keys_and_lengths(String *key_names, String *used_lengths)=0;
264
* Append text representation of quick select structure (what and how is
265
* merged) to str. The result is added to "Extra" field in EXPLAIN output.
269
* This function is implemented only by quick selects that merge other quick
270
* selects output and/or can produce output suitable for merging.
272
virtual void add_info_string(String *)
276
* Returns true if any index used by this quick select
277
* uses field which is marked in passed bitmap.
279
virtual bool is_keys_used(const MyBitmap *fields);
261
282
struct st_qsel_param;
267
MRR range sequence, array<QUICK_RANGE> implementation: sequence traversal
287
* MRR range sequence, array<QUICK_RANGE> implementation: sequence traversal
270
290
typedef struct st_quick_range_seq_ctx
272
292
QUICK_RANGE **first;
277
297
range_seq_t quick_range_seq_init(void *init_param, uint32_t n_ranges, uint32_t flags);
278
298
uint32_t quick_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range);
282
Quick select that does a range scan on a single key. The records are
283
returned in key order.
301
* Quick select that does a range scan on a single key.
303
* The records are returned in key order.
285
306
class QUICK_RANGE_SELECT : public QUICK_SELECT_I
289
DYNAMIC_ARRAY ranges; /* ordered array of range ptrs */
310
DYNAMIC_ARRAY ranges; /**< ordered array of range ptrs */
291
/* Members to deal with case when this quick select is a ROR-merged scan */
312
/** Members to deal with case when this quick select is a ROR-merged scan */
292
313
bool in_ror_merged_scan;
293
MY_BITMAP column_bitmap, *save_read_set, *save_write_set;
294
bool free_file; /* TRUE <=> this->file is "owned" by this quick select */
314
MyBitmap column_bitmap;
315
MyBitmap *save_read_set;
316
MyBitmap *save_write_set;
317
bool free_file; /**< True when this->file is "owned" by this quick select */
296
319
/* Range pointers to be used when not using MRR interface */
297
QUICK_RANGE **cur_range; /* current element in ranges */
320
QUICK_RANGE **cur_range; /**< current element in ranges */
298
321
QUICK_RANGE *last_range;
300
/* Members needed to use the MRR interface */
323
/** Members needed to use the MRR interface */
301
324
QUICK_RANGE_SEQ_CTX qr_traversal_ctx;
303
uint32_t mrr_flags; /* Flags to be used with MRR interface */
305
uint32_t mrr_buf_size; /* copy from thd->variables.read_rnd_buff_size */
306
HANDLER_BUFFER *mrr_buf_desc; /* the handler buffer */
325
uint32_t mrr_buf_size; /**< copy from session->variables.read_rnd_buff_size */
326
HANDLER_BUFFER *mrr_buf_desc; /**< the handler buffer */
308
/* Info about index we're scanning */
328
/** Info about index we're scanning */
309
329
KEY_PART *key_parts;
310
330
KEY_PART_INFO *key_part_info;
312
bool dont_free; /* Used by QUICK_SELECT_DESC */
332
bool dont_free; /**< Used by QUICK_SELECT_DESC */
314
334
int cmp_next(QUICK_RANGE *range);
315
335
int cmp_prev(QUICK_RANGE *range);
316
336
bool row_in_ranges();
338
uint32_t mrr_flags; /**< Flags to be used with MRR interface */
320
QUICK_RANGE_SELECT(THD *thd, Table *table,uint32_t index_arg,bool no_alloc,
321
MEM_ROOT *parent_alloc, bool *create_err);
341
QUICK_RANGE_SELECT(Session *session,
345
MEM_ROOT *parent_alloc,
322
347
~QUICK_RANGE_SELECT();
327
352
void range_end();
328
int get_next_prefix(uint32_t prefix_length, key_part_map keypart_map,
353
int get_next_prefix(uint32_t prefix_length,
354
key_part_map keypart_map,
329
355
unsigned char *cur_prefix);
330
bool reverse_sorted() { return 0; }
356
bool reverse_sorted()
331
360
bool unique_key_range();
332
361
int init_ror_merged_scan(bool reuse_handler);
334
{ file->position(record); }
335
int get_type() { return QS_TYPE_RANGE; }
362
void save_last_pos();
365
return QS_TYPE_RANGE;
336
367
void add_keys_and_lengths(String *key_names, String *used_lengths);
337
368
void add_info_string(String *str);
340
371
QUICK_RANGE_SELECT(const QUICK_RANGE_SELECT& org) : QUICK_SELECT_I()
342
373
memmove(this, &org, sizeof(*this));
344
375
Use default MRR implementation for reverse scans. No table engine
345
376
currently can do an MRR scan with output in reverse index order.
347
378
mrr_buf_desc= NULL;
348
mrr_flags |= HA_MRR_USE_DEFAULT_IMPL;
379
mrr_flags|= HA_MRR_USE_DEFAULT_IMPL;
351
382
friend class TRP_ROR_INTERSECT;
353
QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, Table *table,
354
struct st_table_ref *ref,
384
QUICK_RANGE_SELECT *get_quick_select_for_ref(Session *session, Table *table,
385
struct table_reference_st *ref,
355
386
ha_rows records);
356
friend bool get_quick_keys(PARAM *param, QUICK_RANGE_SELECT *quick,
357
KEY_PART *key, SEL_ARG *key_tree,
387
friend bool get_quick_keys(PARAM *param, QUICK_RANGE_SELECT *quick,
388
KEY_PART *key, SEL_ARG *key_tree,
358
389
unsigned char *min_key, uint32_t min_key_flag,
359
390
unsigned char *max_key, uint32_t max_key_flag);
360
391
friend QUICK_RANGE_SELECT *get_quick_select(PARAM*,uint32_t idx,
486
524
If one of the merged quick selects is a Clustered PK range scan, it is
487
525
used only to filter rowid sequence produced by other merged quick selects.
490
527
class QUICK_ROR_INTERSECT_SELECT : public QUICK_SELECT_I
493
QUICK_ROR_INTERSECT_SELECT(THD *thd, Table *table,
530
QUICK_ROR_INTERSECT_SELECT(Session *session, Table *table,
494
531
bool retrieve_full_rows,
495
532
MEM_ROOT *parent_alloc);
496
533
~QUICK_ROR_INTERSECT_SELECT();
501
bool reverse_sorted() { return false; }
502
bool unique_key_range() { return false; }
503
int get_type() { return QS_TYPE_ROR_INTERSECT; }
538
bool reverse_sorted()
542
bool unique_key_range()
548
return QS_TYPE_ROR_INTERSECT;
504
550
void add_keys_and_lengths(String *key_names, String *used_lengths);
505
551
void add_info_string(String *str);
506
bool is_keys_used(const MY_BITMAP *fields);
552
bool is_keys_used(const MyBitmap *fields);
507
553
int init_ror_merged_scan(bool reuse_handler);
508
554
bool push_quick_back(QUICK_RANGE_SELECT *quick_sel_range);
511
Range quick selects this intersection consists of, not including
557
* Range quick selects this intersection consists of, not including
514
560
List<QUICK_RANGE_SELECT> quick_selects;
517
Merged quick select that uses Clustered PK, if there is one. This quick
518
select is not used for row retrieval, it is used for row retrieval.
563
* Merged quick select that uses Clustered PK, if there is one. This quick
564
* select is not used for row retrieval, it is used for row retrieval.
520
566
QUICK_RANGE_SELECT *cpk_quick;
522
MEM_ROOT alloc; /* Memory pool for this and merged quick selects data. */
523
THD *thd; /* current thread */
524
bool need_to_fetch_row; /* if true, do retrieve full table records. */
525
/* in top-level quick select, true if merged scans where initialized */
568
MEM_ROOT alloc; /**< Memory pool for this and merged quick selects data. */
569
Session *session; /**< Pointer to the current session */
570
bool need_to_fetch_row; /**< if true, do retrieve full table records. */
571
/** in top-level quick select, true if merged scans where initialized */
577
* This function object is defined in drizzled/opt_range.cc
578
* We need this here for the priority_queue definition in the
579
* QUICK_ROR_UNION_SELECT class.
581
class compare_functor;
531
584
Rowid-Ordered Retrieval index union select.
532
585
This quick select produces union of row sequences returned by several
533
586
quick select it "merges".
539
592
ROR-union quick select always retrieves full records.
543
595
class QUICK_ROR_UNION_SELECT : public QUICK_SELECT_I
546
QUICK_ROR_UNION_SELECT(THD *thd, Table *table);
598
QUICK_ROR_UNION_SELECT(Session *session, Table *table);
547
599
~QUICK_ROR_UNION_SELECT();
552
bool reverse_sorted() { return false; }
553
bool unique_key_range() { return false; }
554
int get_type() { return QS_TYPE_ROR_UNION; }
604
bool reverse_sorted()
608
bool unique_key_range()
614
return QS_TYPE_ROR_UNION;
555
616
void add_keys_and_lengths(String *key_names, String *used_lengths);
556
617
void add_info_string(String *str);
557
bool is_keys_used(const MY_BITMAP *fields);
618
bool is_keys_used(const MyBitmap *fields);
559
620
bool push_quick_back(QUICK_SELECT_I *quick_sel_range);
561
List<QUICK_SELECT_I> quick_selects; /* Merged quick selects */
563
QUEUE queue; /* Priority queue for merge operation */
564
MEM_ROOT alloc; /* Memory pool for this and merged quick selects data. */
566
THD *thd; /* current thread */
567
unsigned char *cur_rowid; /* buffer used in get_next() */
568
unsigned char *prev_rowid; /* rowid of last row returned by get_next() */
569
bool have_prev_rowid; /* true if prev_rowid has valid data */
570
uint32_t rowid_length; /* table rowid length */
622
List<QUICK_SELECT_I> quick_selects; /**< Merged quick selects */
624
/** Priority queue for merge operation */
625
std::priority_queue<QUICK_SELECT_I *, std::vector<QUICK_SELECT_I *>, compare_functor > *queue;
626
MEM_ROOT alloc; /**< Memory pool for this and merged quick selects data. */
628
Session *session; /**< current thread */
629
unsigned char *cur_rowid; /**< buffer used in get_next() */
630
unsigned char *prev_rowid; /**< rowid of last row returned by get_next() */
631
bool have_prev_rowid; /**< true if prev_rowid has valid data */
632
uint32_t rowid_length; /**< table rowid length */
572
static int queue_cmp(void *arg, unsigned char *val1, unsigned char *val2);
578
638
Index scan for GROUP-BY queries with MIN/MAX aggregate functions.
580
640
This class provides a specialized index access method for GROUP-BY queries
606
666
Since one of the requirements is that all select fields are part of the same
607
667
index, this class produces only index keys, and not complete records.
610
669
class QUICK_GROUP_MIN_MAX_SELECT : public QUICK_SELECT_I
613
handler *file; /* The handler used to get data. */
614
JOIN *join; /* Descriptor of the current query */
615
KEY *index_info; /* The index chosen for data access */
616
unsigned char *record; /* Buffer where the next record is returned. */
617
unsigned char *tmp_record; /* Temporary storage for next_min(), next_max(). */
618
unsigned char *group_prefix; /* Key prefix consisting of the GROUP fields. */
619
uint32_t group_prefix_len; /* Length of the group prefix. */
620
uint32_t group_key_parts; /* A number of keyparts in the group prefix */
621
unsigned char *last_prefix; /* Prefix of the last group for detecting EOF. */
622
bool have_min; /* Specify whether we are computing */
623
bool have_max; /* a MIN, a MAX, or both. */
624
bool seen_first_key; /* Denotes whether the first key was retrieved.*/
625
KEY_PART_INFO *min_max_arg_part; /* The keypart of the only argument field */
626
/* of all MIN/MAX functions. */
627
uint32_t min_max_arg_len; /* The length of the MIN/MAX argument field */
628
unsigned char *key_infix; /* Infix of constants from equality predicates. */
672
handler *file; /**< The handler used to get data. */
673
JOIN *join; /**< Descriptor of the current query */
674
KEY *index_info; /**< The index chosen for data access */
675
unsigned char *record; /**< Buffer where the next record is returned. */
676
unsigned char *tmp_record; /**< Temporary storage for next_min(), next_max(). */
677
unsigned char *group_prefix; /**< Key prefix consisting of the GROUP fields. */
678
uint32_t group_prefix_len; /**< Length of the group prefix. */
679
uint32_t group_key_parts; /**< A number of keyparts in the group prefix */
680
unsigned char *last_prefix; /**< Prefix of the last group for detecting EOF. */
681
bool have_min; /**< Specify whether we are computing */
682
bool have_max; /**< a MIN, a MAX, or both. */
683
bool seen_first_key; /**< Denotes whether the first key was retrieved.*/
684
KEY_PART_INFO *min_max_arg_part; /** The keypart of the only argument field of all MIN/MAX functions. */
685
uint32_t min_max_arg_len; /**< The length of the MIN/MAX argument field */
686
unsigned char *key_infix; /**< Infix of constants from equality predicates. */
629
687
uint32_t key_infix_len;
630
DYNAMIC_ARRAY min_max_ranges; /* Array of range ptrs for the MIN/MAX field. */
631
uint32_t real_prefix_len; /* Length of key prefix extended with key_infix. */
632
uint32_t real_key_parts; /* A number of keyparts in the above value. */
688
DYNAMIC_ARRAY min_max_ranges; /**< Array of range ptrs for the MIN/MAX field. */
689
uint32_t real_prefix_len; /**< Length of key prefix extended with key_infix. */
690
uint32_t real_key_parts; /**< A number of keyparts in the above value. */
633
691
List<Item_sum> *min_functions;
634
692
List<Item_sum> *max_functions;
635
693
List_iterator<Item_sum> *min_functions_it;
668
bool reverse_sorted() { return false; }
669
bool unique_key_range() { return false; }
670
int get_type() { return QS_TYPE_GROUP_MIN_MAX; }
726
bool reverse_sorted()
730
bool unique_key_range()
736
return QS_TYPE_GROUP_MIN_MAX;
671
738
void add_keys_and_lengths(String *key_names, String *used_lengths);
675
741
class QUICK_SELECT_DESC: public QUICK_RANGE_SELECT
678
QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, uint32_t used_key_parts,
744
QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, uint32_t used_key_parts,
679
745
bool *create_err);
681
747
bool reverse_sorted() { return 1; }
682
748
int get_type() { return QS_TYPE_RANGE_DESC; }
684
750
bool range_reads_after_key(QUICK_RANGE *range);
686
bool test_if_null_range(QUICK_RANGE *range, uint32_t used_key_parts);
688
751
int reset(void) { rev_it.rewind(); return QUICK_RANGE_SELECT::reset(); }
689
752
List<QUICK_RANGE> rev_ranges;
690
753
List_iterator<QUICK_RANGE> rev_it;
757
* Executor class for SELECT statements.
761
* The QUICK_SELECT_I member variable is the implementor
762
* of the SELECT execution.
694
764
class SQL_SELECT :public Sql_alloc {
696
QUICK_SELECT_I *quick; // If quick-select used
697
COND *cond; // where condition
766
QUICK_SELECT_I *quick; /**< If quick-select used */
767
COND *cond; /**< where condition */
699
IO_CACHE file; // Positions to used records
700
ha_rows records; // Records in use if read from file
701
double read_time; // Time to read rows
702
key_map quick_keys; // Possible quick keys
703
key_map needed_reg; // Possible quick keys after prev tables.
704
table_map const_tables,read_tables;
769
IO_CACHE file; /**< Positions to used records */
770
ha_rows records; /**< Records in use if read from file */
771
double read_time; /**< Time to read rows */
772
key_map quick_keys; /**< Possible quick keys */
773
key_map needed_reg; /**< Possible quick keys after prev tables. */
774
table_map const_tables;
775
table_map read_tables;
710
bool check_quick(THD *thd, bool force_quick_range, ha_rows limit)
714
return test_quick_select(thd, tmp, 0, limit, force_quick_range, false) < 0;
716
inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; }
717
int test_quick_select(THD *thd, key_map keys, table_map prev_tables,
718
ha_rows limit, bool force_quick_range,
781
bool check_quick(Session *session, bool force_quick_range, ha_rows limit);
783
int test_quick_select(Session *session, key_map keys, table_map prev_tables,
784
ha_rows limit, bool force_quick_range,
719
785
bool ordered_output);
722
QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, Table *table,
723
struct st_table_ref *ref,
788
QUICK_RANGE_SELECT *get_quick_select_for_ref(Session *session, Table *table,
789
struct table_reference_st *ref,
724
790
ha_rows records);
725
791
uint32_t get_index_for_order(Table *table, order_st *order, ha_rows limit);