Drizzled Public API Documentation

explain_plan.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; version 2 of the License.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 #pragma once
00021 
00022 namespace drizzled {
00023 namespace optimizer {
00024 
00026 enum select_type
00027 { 
00028   ST_PRIMARY,
00029   ST_SIMPLE,
00030   ST_DERIVED,
00031   ST_DEPENDENT_SUBQUERY,
00032   ST_UNCACHEABLE_SUBQUERY,
00033   ST_SUBQUERY,
00034   ST_DEPENDENT_UNION,
00035   ST_UNCACHEABLE_UNION,
00036   ST_UNION,
00037   ST_UNION_RESULT
00038 };
00039 
00040 class ExplainPlan
00041 {
00042 public:
00043 
00044   ExplainPlan()
00045     :
00046       join(NULL),
00047       need_tmp_table(false),
00048       need_order(false),
00049       distinct(false),
00050       message(NULL)
00051   {}
00052 
00053   ExplainPlan(Join *in_join,
00054               bool in_need_tmp_table,
00055               bool in_need_order,
00056               bool in_distinct,
00057               const char *in_message)
00058     :
00059       join(in_join),
00060       need_tmp_table(in_need_tmp_table),
00061       need_order(in_need_order),
00062       distinct(in_distinct),
00063       message(in_message)
00064   {}
00065 
00066   void printPlan();
00067 
00068   bool explainUnion(Session *session,
00069                     Select_Lex_Unit *unit,
00070                     select_result *result);
00071 
00072 private:
00073 
00074   Join *join;
00075 
00076   bool need_tmp_table;
00077 
00078   bool need_order;
00079 
00080   bool distinct;
00081 
00082   const char *message;
00083 };
00084 
00085 } /* namespace optimizer */
00086 
00087 } /* namespace drizzled */
00088