Commit a5a54128 authored by Sergey Petrunya's avatar Sergey Petrunya

Make table_elimination=on|off flag to be always present in @@optimizer_switch.

parent e68ed6f1
...@@ -591,37 +591,16 @@ class Default_object_creation_ctx : public Object_creation_ctx ...@@ -591,37 +591,16 @@ class Default_object_creation_ctx : public Object_creation_ctx
#define OPTIMIZER_SWITCH_JOIN_CACHE_HASHED (1ULL << 22) #define OPTIMIZER_SWITCH_JOIN_CACHE_HASHED (1ULL << 22)
#define OPTIMIZER_SWITCH_JOIN_CACHE_BKA (1ULL << 23) #define OPTIMIZER_SWITCH_JOIN_CACHE_BKA (1ULL << 23)
#define OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE (1ULL << 24) #define OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE (1ULL << 24)
#ifdef DBUG_OFF #define OPTIMIZER_SWITCH_TABLE_ELIMINATION (1ULL << 25)
# define OPTIMIZER_SWITCH_LAST (1ULL << 25) #define OPTIMIZER_SWITCH_LAST (1ULL << 26)
#else
# define OPTIMIZER_SWITCH_TABLE_ELIMINATION (1ULL << 25)
# define OPTIMIZER_SWITCH_LAST (1ULL << 26)
#endif
#ifdef DBUG_OFF
/* The following must be kept in sync with optimizer_switch_str in mysqld.cc */ /* The following must be kept in sync with optimizer_switch_str in mysqld.cc */
/* /*
TODO: Materialization is off by default to mimic 5.1/5.2 behavior. TODO: Materialization is off by default to mimic 5.1/5.2 behavior.
Once cost based choice between materialization and in-to-exists should be Once cost based choice between materialization and in-to-exists should be
enabled by default, add OPTIMIZER_SWITCH_MATERIALIZATION enabled by default, add OPTIMIZER_SWITCH_MATERIALIZATION
*/ */
# define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ #define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \
OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \
OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \
OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \
OPTIMIZER_SWITCH_DERIVED_MERGE | \
OPTIMIZER_SWITCH_DERIVED_WITH_KEYS | \
OPTIMIZER_SWITCH_IN_TO_EXISTS | \
OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\
OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN|\
OPTIMIZER_SWITCH_SUBQUERY_CACHE|\
OPTIMIZER_SWITCH_SUBQUERY_CACHE | \
OPTIMIZER_SWITCH_JOIN_CACHE_INCREMENTAL | \
OPTIMIZER_SWITCH_JOIN_CACHE_HASHED | \
OPTIMIZER_SWITCH_JOIN_CACHE_BKA | \
OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE)
#else
# define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \
OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \
OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \ OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \
OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \ OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \
...@@ -636,7 +615,6 @@ enabled by default, add OPTIMIZER_SWITCH_MATERIALIZATION ...@@ -636,7 +615,6 @@ enabled by default, add OPTIMIZER_SWITCH_MATERIALIZATION
OPTIMIZER_SWITCH_JOIN_CACHE_HASHED | \ OPTIMIZER_SWITCH_JOIN_CACHE_HASHED | \
OPTIMIZER_SWITCH_JOIN_CACHE_BKA | \ OPTIMIZER_SWITCH_JOIN_CACHE_BKA | \
OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE) OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE)
#endif
/* /*
Replication uses 8 bytes to store SQL_MODE in the binary log. The day you Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
......
...@@ -350,9 +350,7 @@ static const char *optimizer_switch_names[]= ...@@ -350,9 +350,7 @@ static const char *optimizer_switch_names[]=
"join_cache_hashed", "join_cache_hashed",
"join_cache_bka", "join_cache_bka",
"optimize_join_buffer_size", "optimize_join_buffer_size",
#ifndef DBUG_OFF
"table_elimination", "table_elimination",
#endif
"default", NullS "default", NullS
}; };
...@@ -384,9 +382,7 @@ static const unsigned int optimizer_switch_names_len[]= ...@@ -384,9 +382,7 @@ static const unsigned int optimizer_switch_names_len[]=
sizeof("join_cache_hashed") - 1, sizeof("join_cache_hashed") - 1,
sizeof("join_cache_bka") - 1, sizeof("join_cache_bka") - 1,
sizeof("optimize_join_buffer_size") - 1, sizeof("optimize_join_buffer_size") - 1,
#ifndef DBUG_OFF
sizeof("table_elimination") - 1, sizeof("table_elimination") - 1,
#endif
sizeof("default") - 1 sizeof("default") - 1
}; };
TYPELIB optimizer_switch_typelib= { array_elements(optimizer_switch_names)-1,"", TYPELIB optimizer_switch_typelib= { array_elements(optimizer_switch_names)-1,"",
...@@ -502,12 +498,9 @@ static const char *optimizer_switch_str="index_merge=on,index_merge_union=on," ...@@ -502,12 +498,9 @@ static const char *optimizer_switch_str="index_merge=on,index_merge_union=on,"
"join_cache_incremental=on," "join_cache_incremental=on,"
"join_cache_hashed=on," "join_cache_hashed=on,"
"join_cache_bka=on," "join_cache_bka=on,"
"optimize_join_buffer_size=on" "optimize_join_buffer_size=on,"
#ifndef DBUG_OFF "table_elimination=on";
",table_elimination=on";
#else
; ;
#endif
#ifdef SAFEMALLOC #ifdef SAFEMALLOC
my_bool sf_malloc_trough_check= 0; my_bool sf_malloc_trough_check= 0;
#endif #endif
...@@ -7559,9 +7552,7 @@ each time the SQL thread starts.", ...@@ -7559,9 +7552,7 @@ each time the SQL thread starts.",
"subquery_cache, outer_join_with_cache, semijoin_with_cache, " "subquery_cache, outer_join_with_cache, semijoin_with_cache, "
"join_cache_incremental, join_cache_hashed, join_cache_bka, " "join_cache_incremental, join_cache_hashed, join_cache_bka, "
"optimize_join_buffer_size" "optimize_join_buffer_size"
#ifndef DBUG_OFF
", table_elimination" ", table_elimination"
#endif
"} and val={on, off, default}.", "} and val={on, off, default}.",
&optimizer_switch_str, &optimizer_switch_str, 0, GET_STR, REQUIRED_ARG, &optimizer_switch_str, &optimizer_switch_str, 0, GET_STR, REQUIRED_ARG,
/*OPTIMIZER_SWITCH_DEFAULT*/0, 0, 0, 0, 0, 0}, /*OPTIMIZER_SWITCH_DEFAULT*/0, 0, 0, 0, 0, 0},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment