~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/range.h

  • Committer: Mark Atwood
  • Date: 2011-10-27 05:08:12 UTC
  • mfrom: (2445.1.11 rf)
  • Revision ID: me@mark.atwood.name-20111027050812-1icvs72lb0u4xdc4
mergeĀ lp:~olafvdspek/drizzle/refactor8

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
/* classes to use when handling where clause */
21
21
 
22
 
#ifndef DRIZZLED_OPTIMIZER_RANGE_H
23
 
#define DRIZZLED_OPTIMIZER_RANGE_H
 
22
#pragma once
24
23
 
25
 
#include "drizzled/field.h"
26
 
#include "drizzled/item/sum.h"
 
24
#include <drizzled/field.h>
 
25
#include <drizzled/item/sum.h>
 
26
#include <drizzled/table_reference.h>
27
27
 
28
28
#include <queue>
29
29
 
30
 
namespace drizzled
31
 
{
32
 
 
33
 
class Join;
34
 
class RorIntersectReadPlan; 
35
 
typedef class Item COND;
36
 
 
37
 
namespace internal
38
 
{
39
 
typedef struct st_io_cache IO_CACHE;
40
 
}
 
30
#include <boost/dynamic_bitset.hpp>
 
31
 
 
32
namespace drizzled {
41
33
 
42
34
typedef struct st_key_part
43
35
{
56
48
} KEY_PART;
57
49
 
58
50
 
59
 
namespace optimizer
60
 
{
61
 
 
62
 
class Parameter;
63
 
class SEL_ARG;
 
51
namespace optimizer {
64
52
 
65
53
/**
66
54
  Quick select interface.
238
226
   * 
239
227
   * @note This is used by during explain plan.
240
228
   */
241
 
  virtual void add_keys_and_lengths(String *key_names, String *used_lengths)=0;
 
229
  virtual void add_keys_and_lengths(std::string *key_names,
 
230
                                    std::string *used_lengths)=0;
242
231
 
243
232
  /**
244
233
   * Append text representation of quick select structure (what and how is
249
238
   * This function is implemented only by quick selects that merge other quick
250
239
   * selects output and/or can produce output suitable for merging.
251
240
   */
252
 
  virtual void add_info_string(String *) 
 
241
  virtual void add_info_string(std::string *)
253
242
  {}
254
 
  
 
243
 
255
244
  /**
256
245
   * Returns true if any index used by this quick select
257
246
   * uses field which is marked in passed bitmap.
259
248
  virtual bool is_keys_used(const boost::dynamic_bitset<>& fields);
260
249
};
261
250
 
262
 
struct st_qsel_param;
263
 
class QuickRange;
264
 
class QuickRangeSelect;
265
 
 
266
251
/**
267
252
 * MRR range sequence, array<QuickRange> implementation: sequence traversal
268
253
 * context.
292
277
  QuickSelectInterface *quick; /**< If quick-select used */
293
278
  COND *cond; /**< where condition */
294
279
  Table *head;
295
 
  internal::IO_CACHE *file; /**< Positions to used records */
 
280
  internal::io_cache_st *file; /**< Positions to used records */
296
281
  ha_rows records; /**< Records in use if read from file */
297
282
  double read_time; /**< Time to read rows */
298
283
  key_map quick_keys; /**< Possible quick keys */
312
297
};
313
298
 
314
299
QuickRangeSelect *get_quick_select_for_ref(Session *session, 
315
 
                                             Table *table,
316
 
                                             struct table_reference_st *ref,
317
 
                                             ha_rows records);
 
300
                                           Table *table,
 
301
                                           table_reference_st *ref,
 
302
                                           ha_rows records);
318
303
 
319
304
/*
320
305
  Create a QuickRangeSelect from given key and SEL_ARG tree for that key.
367
352
 
368
353
} /* namespace drizzled */
369
354
 
370
 
#endif /* DRIZZLED_OPTIMIZER_RANGE_H */