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
00024 class Join;
00025 class Session;
00026 class Select_Lex_Unit;
00027 class select_result;
00028
00029 namespace optimizer
00030 {
00031
00033 enum select_type
00034 {
00035 ST_PRIMARY,
00036 ST_SIMPLE,
00037 ST_DERIVED,
00038 ST_DEPENDENT_SUBQUERY,
00039 ST_UNCACHEABLE_SUBQUERY,
00040 ST_SUBQUERY,
00041 ST_DEPENDENT_UNION,
00042 ST_UNCACHEABLE_UNION,
00043 ST_UNION,
00044 ST_UNION_RESULT
00045 };
00046
00047 class ExplainPlan
00048 {
00049 public:
00050
00051 ExplainPlan()
00052 :
00053 join(NULL),
00054 need_tmp_table(false),
00055 need_order(false),
00056 distinct(false),
00057 message(NULL)
00058 {}
00059
00060 ExplainPlan(Join *in_join,
00061 bool in_need_tmp_table,
00062 bool in_need_order,
00063 bool in_distinct,
00064 const char *in_message)
00065 :
00066 join(in_join),
00067 need_tmp_table(in_need_tmp_table),
00068 need_order(in_need_order),
00069 distinct(in_distinct),
00070 message(in_message)
00071 {}
00072
00073 void printPlan();
00074
00075 bool explainUnion(Session *session,
00076 Select_Lex_Unit *unit,
00077 select_result *result);
00078
00079 private:
00080
00081 Join *join;
00082
00083 bool need_tmp_table;
00084
00085 bool need_order;
00086
00087 bool distinct;
00088
00089 const char *message;
00090 };
00091
00092 }
00093
00094 }
00095