00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 #include <drizzled/optimizer/range.h>
00023 #include <drizzled/records.h>
00024
00025 #include <boost/dynamic_bitset.hpp>
00026 #include <vector>
00027
00028 namespace drizzled
00029 {
00030
00031 namespace optimizer
00032 {
00033
00092 class QuickIndexMergeSelect : public QuickSelectInterface
00093 {
00094 public:
00095
00096 QuickIndexMergeSelect(Session *session, Table *table);
00097
00098 ~QuickIndexMergeSelect();
00099
00100 int init();
00101 int reset(void);
00102
00111 int get_next();
00112
00113 bool reverse_sorted() const
00114 {
00115 return false;
00116 }
00117
00118 bool unique_key_range() const
00119 {
00120 return false;
00121 }
00122
00123 int get_type() const
00124 {
00125 return QS_TYPE_INDEX_MERGE;
00126 }
00127
00128 void add_keys_and_lengths(std::string *key_names, std::string *used_lengths);
00129 void add_info_string(std::string *str);
00130 bool is_keys_used(const boost::dynamic_bitset<>& fields);
00131
00132 bool push_quick_back(QuickRangeSelect *quick_sel_range);
00133
00134
00135 std::vector<QuickRangeSelect *> quick_selects;
00136
00137
00138 QuickRangeSelect *pk_quick_select;
00139
00140
00141 bool doing_pk_scan;
00142
00143 memory::Root alloc;
00144 Session *session;
00145
00162 int read_keys_and_merge();
00163
00164
00165 ReadRecord read_record;
00166 };
00167
00168 }
00169
00170 }
00171