1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2009 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_OPTIMIZER_KEY_USE_H
21
#define DRIZZLED_OPTIMIZER_KEY_USE_H
23
#include <drizzled/server_includes.h>
44
null_rejecting(false),
48
KeyUse(Table *in_table,
50
table_map in_used_tables,
54
key_part_map in_keypart_map,
55
ha_rows in_ref_table_rows,
56
bool in_null_rejecting,
61
used_tables(in_used_tables),
64
optimize(in_optimize),
65
keypart_map(in_keypart_map),
66
ref_table_rows(in_ref_table_rows),
67
null_rejecting(in_null_rejecting),
68
cond_guard(in_cond_guard)
81
table_map getUsedTables()
86
uint32_t getKey() const
91
uint32_t getKeypart() const
96
uint32_t getOptimizeFlags() const
101
key_part_map getKeypartMap()
106
ha_rows getTableRows() const
108
return ref_table_rows;
111
void setTableRows(ha_rows input)
113
ref_table_rows= input;
116
bool isNullRejected() const
118
return null_rejecting;
121
bool *getConditionalGuard()
128
Table *table; /**< Pointer to the table this key belongs to */
130
Item *val; /**< or value if no field */
132
table_map used_tables;
138
uint32_t optimize; /**< 0, or KEY_OPTIMIZE_* */
140
key_part_map keypart_map;
142
ha_rows ref_table_rows;
145
* If true, the comparison this value was created from will not be
146
* satisfied if val has NULL 'value'.
151
* !NULL - This KeyUse was created from an equality that was wrapped into
152
* an Item_func_trig_cond. This means the equality (and validity of
153
* this KeyUse element) can be turned on and off. The on/off state
154
* is indicted by the pointed value:
155
* *cond_guard == true <=> equality condition is on
156
* *cond_guard == false <=> equality condition is off
158
* NULL - Otherwise (the source equality can't be turned off)
163
} /* end namespace optimizer */
165
} /* end namespace drizzled */
167
#endif /* DRIZZLED_OPTIMIZER_KEY_USE_H */