Drizzled Public API Documentation

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