~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/quick_index_merge_select.cc

  • Committer: Mark Atwood
  • Date: 2011-06-24 11:45:17 UTC
  • mfrom: (2318.6.64 rf)
  • Revision ID: me@mark.atwood.name-20110624114517-1mq8no6jlp2nrg7m
mergeĀ lp:~olafvdspek/drizzle/refactor15

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
 
207
207
bool optimizer::QuickIndexMergeSelect::is_keys_used(const boost::dynamic_bitset<>& fields)
208
208
{
209
 
  for (vector<optimizer::QuickRangeSelect *>::iterator it= quick_selects.begin();
210
 
       it != quick_selects.end();
211
 
       ++it)
 
209
  BOOST_FOREACH(QuickRangeSelect* it, quick_selects)
212
210
  {
213
 
    if (is_key_used(head, (*it)->index, fields))
214
 
    {
 
211
    if (is_key_used(head, it->index, fields))
215
212
      return 1;
216
 
    }
217
213
  }
218
214
  return 0;
219
215
}
223
219
{
224
220
  bool first= true;
225
221
  str->append("sort_union(");
226
 
  for (vector<optimizer::QuickRangeSelect *>::iterator it= quick_selects.begin();
227
 
       it != quick_selects.end();
228
 
       ++it)
 
222
  BOOST_FOREACH(QuickRangeSelect* it, quick_selects)
229
223
  {
230
224
    if (! first)
231
225
      str->append(",");
232
226
    else
233
227
      first= false;
234
 
    (*it)->add_info_string(str);
 
228
    it->add_info_string(str);
235
229
  }
236
230
  if (pk_quick_select)
237
231
  {
249
243
  uint32_t length= 0;
250
244
  bool first= true;
251
245
 
252
 
  for (vector<optimizer::QuickRangeSelect *>::iterator it= quick_selects.begin();
253
 
       it != quick_selects.end();
254
 
       ++it)
 
246
  BOOST_FOREACH(QuickRangeSelect* it, quick_selects)
255
247
  {
256
248
    if (first)
257
249
      first= false;
261
253
      used_lengths->append(",");
262
254
    }
263
255
 
264
 
    KeyInfo *key_info= head->key_info + (*it)->index;
 
256
    KeyInfo *key_info= head->key_info + it->index;
265
257
    key_names->append(key_info->name);
266
 
    length= internal::int64_t2str((*it)->max_used_key_length, buf, 10) - buf;
 
258
    length= internal::int64_t2str(it->max_used_key_length, buf, 10) - buf;
267
259
    used_lengths->append(buf, length);
268
260
  }
269
261
  if (pk_quick_select)