~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/range_param.h

Updated an include guard thanks to a nice catch during code review from Jay. Thanks Jay!

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_OPTIMIZER_RANGE_PARAM_H
21
 
#define DRIZZLED_OPTIMIZER_RANGE_PARAM_H
 
20
#ifndef DRIZZLE_OPTIMIZER_RANGE_PARAM_H
 
21
#define DRIZZLE_OPTIMIZER_RANGE_PARAM_H
22
22
 
23
23
#include "drizzled/field.h"
24
24
 
25
 
namespace drizzled
26
 
{
27
 
 
28
25
typedef class Item COND;
29
26
typedef struct st_key_part KEY_PART;
30
27
 
 
28
namespace drizzled
 
29
{
 
30
 
31
31
namespace optimizer
32
32
{
33
33
 
34
34
class RangeParameter
35
35
{
36
36
public:
37
 
 
38
 
  RangeParameter()
39
 
    :
40
 
      session(NULL),
41
 
      table(NULL),
42
 
      cond(NULL),
43
 
      prev_tables(),
44
 
      read_tables(),
45
 
      current_table(),
46
 
      key_parts(NULL),
47
 
      key_parts_end(NULL),
48
 
      mem_root(NULL),
49
 
      old_root(NULL),
50
 
      keys(0),
51
 
      using_real_indexes(false),
52
 
      remove_jump_scans(false),
53
 
      alloced_sel_args(0),
54
 
      force_default_mrr(false)
55
 
  {}
56
 
 
57
37
  Session       *session;   /* Current thread handle */
58
38
  Table *table; /* Table being analyzed */
59
39
  COND *cond;   /* Used inside get_mm_tree(). */
64
44
  /* Array of parts of all keys for which range analysis is performed */
65
45
  KEY_PART *key_parts;
66
46
  KEY_PART *key_parts_end;
67
 
  memory::Root *mem_root; /* Memory that will be freed when range analysis completes */
68
 
  memory::Root *old_root; /* Memory that will last until the query end */
 
47
  MEM_ROOT *mem_root; /* Memory that will be freed when range analysis completes */
 
48
  MEM_ROOT *old_root; /* Memory that will last until the query end */
69
49
  /*
70
50
    Number of indexes used in range analysis (In SEL_TREE::keys only first
71
51
    #keys elements are not empty)
94
74
class Parameter : public RangeParameter
95
75
{
96
76
public:
97
 
 
98
 
  Parameter()
99
 
    :
100
 
      RangeParameter(),
101
 
      max_key_part(0),
102
 
      range_count(0),
103
 
      quick(false),
104
 
      fields_bitmap_size(0),
105
 
      needed_fields(),
106
 
      tmp_covered_fields(),
107
 
      needed_reg(NULL),
108
 
      imerge_cost_buff(NULL),
109
 
      imerge_cost_buff_size(0),
110
 
      is_ror_scan(false),
111
 
      n_ranges(0)
112
 
  {}
113
 
 
114
77
  KEY_PART *key[MAX_KEY]; /* First key parts of keys used in the query */
115
78
  uint32_t max_key_part;
116
79
  /* Number of ranges in the last checked tree->key */
117
80
  uint32_t range_count;
118
 
  unsigned char min_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
119
 
  unsigned char max_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
120
 
  bool quick; // Don't calulate possible keys
 
81
  unsigned char min_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH],
 
82
    max_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
 
83
  bool quick;                           // Don't calulate possible keys
121
84
 
122
85
  uint32_t fields_bitmap_size;
123
86
  MyBitmap needed_fields;    /* bitmask of fields needed by the query */
138
101
 
139
102
} /* namespace drizzled */
140
103
 
141
 
#endif /* DRIZZLED_OPTIMIZER_RANGE_PARAM_H */
 
104
#endif /* DRIZZLE_OPTIMIZER_RANGE_PARAM_H */