00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 }
00086
00087 }
00088