~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/explain_plan.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-09-17 00:08:20 UTC
  • mto: (1126.9.3 captain-20090915-01)
  • mto: This revision was merged to the branch mainline in revision 1133.
  • Revision ID: osullivan.padraig@gmail.com-20090917000820-urd6p46qngi1okjp
Updated calls to some dtrace probes to cast the parameter to const char *
appropriately. Also, removed the additional variable in places that I was
using.

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) 2008-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_EXPLAIN_PLAN_H
21
 
#define DRIZZLED_OPTIMIZER_EXPLAIN_PLAN_H
22
 
 
23
 
namespace drizzled
24
 
{
25
 
 
26
 
class Session;
27
 
class Select_Lex_Unit;
28
 
class select_result;
29
 
 
30
 
namespace optimizer
31
 
{
32
 
 
33
 
/** select type for EXPLAIN */
34
 
enum select_type
35
 
36
 
  ST_PRIMARY,
37
 
  ST_SIMPLE,
38
 
  ST_DERIVED,
39
 
  ST_DEPENDENT_SUBQUERY,
40
 
  ST_UNCACHEABLE_SUBQUERY,
41
 
  ST_SUBQUERY,
42
 
        ST_DEPENDENT_UNION,
43
 
  ST_UNCACHEABLE_UNION,
44
 
  ST_UNION,
45
 
  ST_UNION_RESULT
46
 
};
47
 
 
48
 
class ExplainPlan
49
 
{
50
 
public:
51
 
 
52
 
  ExplainPlan()
53
 
    :
54
 
      join(NULL),
55
 
      need_tmp_table(false),
56
 
      need_order(false),
57
 
      distinct(false),
58
 
      message(NULL)
59
 
  {}
60
 
 
61
 
  ExplainPlan(JOIN *in_join,
62
 
              bool in_need_tmp_table,
63
 
              bool in_need_order,
64
 
              bool in_distinct,
65
 
              const char *in_message)
66
 
    :
67
 
      join(in_join),
68
 
      need_tmp_table(in_need_tmp_table),
69
 
      need_order(in_need_order),
70
 
      distinct(in_distinct),
71
 
      message(in_message)
72
 
  {}
73
 
 
74
 
  void printPlan();
75
 
 
76
 
  bool explainUnion(Session *session,
77
 
                    Select_Lex_Unit *unit,
78
 
                    select_result *result);
79
 
 
80
 
private:
81
 
 
82
 
  JOIN *join;
83
 
 
84
 
  bool need_tmp_table;
85
 
 
86
 
  bool need_order;
87
 
 
88
 
  bool distinct;
89
 
 
90
 
  const char *message;
91
 
};
92
 
 
93
 
} /* namespace optimizer */
94
 
 
95
 
} /* namespace drizzled */
96
 
 
97
 
#endif /* DRIZZLED_OPTIMIZER_EXPLAIN_PLAN_H */