~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join_table.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-09-13 00:53:34 UTC
  • mto: (1126.9.2 captain-20090915-01)
  • mto: This revision was merged to the branch mainline in revision 1133.
  • Revision ID: osullivan.padraig@gmail.com-20090913005334-6wio2sbjugskfbm3
Added calls to the connection start/end dtrace probes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 * used in the nested loops join implementation.
26
26
 */
27
27
 
28
 
#ifndef DRIZZLED_JOIN_TABLE_H
29
 
#define DRIZZLED_JOIN_TABLE_H
 
28
#ifndef DRIZZLED_JOINTABLE_H
 
29
#define DRIZZLED_JOINTABLE_H
30
30
 
31
 
#include "drizzled/enum_nested_loop_state.h"
32
 
#include "drizzled/table_reference.h"
33
 
#include "drizzled/optimizer/range.h"
34
 
#include "drizzled/join_cache.h"
35
 
#include "drizzled/optimizer/key_use.h"
 
31
#include <drizzled/enum_nested_loop_state.h>
 
32
#include <drizzled/table_reference.h>
 
33
#include <drizzled/opt_range.h>
 
34
#include <drizzled/join_cache.h>
36
35
 
37
36
#include <bitset>
38
37
 
39
 
namespace drizzled
40
 
{
41
 
 
42
38
/* Values for JoinTable::packed_info */
43
39
#define TAB_INFO_HAVE_VALUE 1
44
40
#define TAB_INFO_USING_INDEX 2
45
41
#define TAB_INFO_USING_WHERE 4
46
42
#define TAB_INFO_FULL_SCAN_ON_NULL 8
47
43
 
 
44
class KeyUse;
48
45
class Table;
 
46
class SQL_SELECT;
49
47
 
50
48
 
51
49
/** Description of an access method */
70
68
class JoinTable 
71
69
{
72
70
public:
73
 
  JoinTable() :
74
 
    table(NULL),
75
 
    keyuse(NULL),
76
 
    select(NULL),
77
 
    select_cond(NULL),
78
 
    quick(NULL),
79
 
    pre_idx_push_select_cond(NULL),
80
 
    on_expr_ref(NULL),
81
 
    cond_equal(NULL),
82
 
    first_inner(NULL),
83
 
    found(false),
84
 
    not_null_compl(false),
85
 
    last_inner(NULL),
86
 
    first_upper(NULL),
87
 
    first_unmatched(NULL),
88
 
    packed_info(0),
89
 
    read_first_record(NULL),
90
 
    next_select(NULL),
91
 
    worst_seeks(0.0),
92
 
    const_keys(0),
93
 
    checked_keys(0),
94
 
    needed_reg(0),
95
 
    keys(0),
96
 
    records(0),
97
 
    found_records(0),
98
 
    read_time(0),
99
 
    dependent(0),
100
 
    key_dependent(0),
101
 
    use_quick(0),
102
 
    index(0),
103
 
    status(0),
104
 
    used_fields(0),
105
 
    used_fieldlength(0),
106
 
    used_blobs(0),
107
 
    type(AM_UNKNOWN),
108
 
    cached_eq_ref_table(0),
109
 
    eq_ref_table(0),
110
 
    not_used_in_distinct(0),
111
 
    sorted(0),
112
 
    limit(0),
113
 
    join(NULL),
114
 
    insideout_match_tab(NULL),
115
 
    insideout_buf(NULL),
116
 
    found_match(false),
117
 
    rowid_keep_flags(0),
118
 
    embedding_map(0)
119
 
  {}
 
71
  JoinTable() {} /* Remove gcc warning */
120
72
  Table *table;
121
 
  optimizer::KeyUse *keyuse; /**< pointer to first used key */
122
 
  optimizer::SqlSelect *select;
 
73
  KeyUse *keyuse; /**< pointer to first used key */
 
74
  SQL_SELECT *select;
123
75
  COND *select_cond;
124
 
  optimizer::QuickSelectInterface *quick;
 
76
  QUICK_SELECT_I *quick;
125
77
  /**
126
78
    The value of select_cond before we've attempted to do Index Condition
127
79
    Pushdown. We may need to restore everything back if we first choose one
237
189
  {
238
190
    return (select && select->quick &&
239
191
            (select->quick->get_type() ==
240
 
             optimizer::QuickSelectInterface::QS_TYPE_GROUP_MIN_MAX));
 
192
             QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX));
241
193
  }
242
194
 
243
195
  void readCachedRecord();
244
196
};
245
197
 
246
 
} /* namespace drizzled */
247
 
 
248
 
#endif /* DRIZZLED_JOIN_TABLE_H */
 
198
#endif /* DRIZZLED_JOINTABLE_H */