~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/key_use.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-09-18 00:22:38 UTC
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: osullivan.padraig@gmail.com-20090918002238-zq7mui4r2yzoidz1
Extracted KeyUse into its own header file and placed it within the
drizzled::optimizer namespace.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2009 Sun Microsystems
 
5
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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
 
18
 */
 
19
 
 
20
#ifndef DRIZZLED_OPTIMIZER_KEY_USE_H
 
21
#define DRIZZLED_OPTIMIZER_KEY_USE_H
 
22
 
 
23
#include <drizzled/server_includes.h>
 
24
 
 
25
#include <vector>
 
26
 
 
27
namespace drizzled
 
28
{
 
29
namespace optimizer
 
30
{
 
31
 
 
32
class KeyUse 
 
33
{
 
34
public:
 
35
  Table *table; /**< Pointer to the table this key belongs to */
 
36
  Item *val;    /**< or value if no field */
 
37
  table_map used_tables;
 
38
  uint32_t key;
 
39
  uint32_t keypart;
 
40
  uint32_t optimize; /**< 0, or KEY_OPTIMIZE_* */
 
41
  key_part_map keypart_map;
 
42
  ha_rows ref_table_rows;
 
43
  /**
 
44
    If true, the comparison this value was created from will not be
 
45
    satisfied if val has NULL 'value'.
 
46
  */
 
47
  bool null_rejecting;
 
48
  /**
 
49
    !NULL - This KeyUse was created from an equality that was wrapped into
 
50
            an Item_func_trig_cond. This means the equality (and validity of
 
51
            this KeyUse element) can be turned on and off. The on/off state
 
52
            is indicted by the pointed value:
 
53
              *cond_guard == true <=> equality condition is on
 
54
              *cond_guard == false <=> equality condition is off
 
55
 
 
56
    NULL  - Otherwise (the source equality can't be turned off)
 
57
  */
 
58
  bool *cond_guard;
 
59
};
 
60
 
 
61
} /* end namespace optimizer */
 
62
 
 
63
} /* end namespace drizzled */
 
64
 
 
65
#endif /* DRIZZLED_OPTIMIZER_KEY_USE_H */