mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/home/pem/work/mysql-5.0
This commit is contained in:
@ -108,15 +108,15 @@ insert into t7 values (18,2,3,4,5,6);
|
||||
insert into t7 values (19,2,3,4,5,6);
|
||||
insert into t7 values (20,2,3,4,5,6);
|
||||
insert into t7 values (21,2,3,4,5,6);
|
||||
select @@plan_search_depth;
|
||||
@@plan_search_depth
|
||||
select @@optimizer_search_depth;
|
||||
@@optimizer_search_depth
|
||||
62
|
||||
select @@heuristic;
|
||||
@@heuristic
|
||||
select @@optimizer_prune_level;
|
||||
@@optimizer_prune_level
|
||||
1
|
||||
set plan_search_depth=63;
|
||||
select @@plan_search_depth;
|
||||
@@plan_search_depth
|
||||
set optimizer_search_depth=63;
|
||||
select @@optimizer_search_depth;
|
||||
@@optimizer_search_depth
|
||||
63
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@ -190,13 +190,13 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
Last_query_cost 794.838037
|
||||
set heuristic=0;
|
||||
select @@heuristic;
|
||||
@@heuristic
|
||||
set optimizer_prune_level=0;
|
||||
select @@optimizer_prune_level;
|
||||
@@optimizer_prune_level
|
||||
0
|
||||
set plan_search_depth=0;
|
||||
select @@plan_search_depth;
|
||||
@@plan_search_depth
|
||||
set optimizer_search_depth=0;
|
||||
select @@optimizer_search_depth;
|
||||
@@optimizer_search_depth
|
||||
0
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@ -270,9 +270,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
Last_query_cost 274.419727
|
||||
set plan_search_depth=1;
|
||||
select @@plan_search_depth;
|
||||
@@plan_search_depth
|
||||
set optimizer_search_depth=1;
|
||||
select @@optimizer_search_depth;
|
||||
@@optimizer_search_depth
|
||||
1
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@ -346,9 +346,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
Last_query_cost 794.838037
|
||||
set plan_search_depth=62;
|
||||
select @@plan_search_depth;
|
||||
@@plan_search_depth
|
||||
set optimizer_search_depth=62;
|
||||
select @@optimizer_search_depth;
|
||||
@@optimizer_search_depth
|
||||
62
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@ -422,13 +422,13 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
Last_query_cost 274.419727
|
||||
set heuristic=1;
|
||||
select @@heuristic;
|
||||
@@heuristic
|
||||
set optimizer_prune_level=1;
|
||||
select @@optimizer_prune_level;
|
||||
@@optimizer_prune_level
|
||||
1
|
||||
set plan_search_depth=0;
|
||||
select @@plan_search_depth;
|
||||
@@plan_search_depth
|
||||
set optimizer_search_depth=0;
|
||||
select @@optimizer_search_depth;
|
||||
@@optimizer_search_depth
|
||||
0
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@ -502,9 +502,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
Last_query_cost 794.838037
|
||||
set plan_search_depth=1;
|
||||
select @@plan_search_depth;
|
||||
@@plan_search_depth
|
||||
set optimizer_search_depth=1;
|
||||
select @@optimizer_search_depth;
|
||||
@@optimizer_search_depth
|
||||
1
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@ -578,9 +578,9 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
show status like 'Last_query_cost';
|
||||
Variable_name Value
|
||||
Last_query_cost 794.838037
|
||||
set plan_search_depth=62;
|
||||
select @@plan_search_depth;
|
||||
@@plan_search_depth
|
||||
set optimizer_search_depth=62;
|
||||
select @@optimizer_search_depth;
|
||||
@@optimizer_search_depth
|
||||
62
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
|
@ -137,21 +137,21 @@ insert into t7 values (21,2,3,4,5,6);
|
||||
|
||||
# Check the default values for the optimizer paramters
|
||||
|
||||
select @@plan_search_depth;
|
||||
select @@heuristic;
|
||||
select @@optimizer_search_depth;
|
||||
select @@optimizer_prune_level;
|
||||
|
||||
-- This value swithes back to the old implementation of 'find_best()'
|
||||
-- set plan_search_depth=63; - old (independent of the heuristic)
|
||||
-- set optimizer_search_depth=63; - old (independent of the optimizer_prune_level)
|
||||
--
|
||||
-- These are the values for the parameters that control the greedy optimizer
|
||||
-- (total 6 combinations - 3 for plan_search_depth, 2 for heuristic):
|
||||
-- (total 6 combinations - 3 for optimizer_search_depth, 2 for optimizer_prune_level):
|
||||
--
|
||||
-- set plan_search_depth=0; - automatic
|
||||
-- set plan_search_depth=1; - min
|
||||
-- set plan_search_depth=62; - max (default)
|
||||
-- set optimizer_search_depth=0; - automatic
|
||||
-- set optimizer_search_depth=1; - min
|
||||
-- set optimizer_search_depth=62; - max (default)
|
||||
--
|
||||
-- set heuristic=0 - exhaustive;
|
||||
-- set heuristic=1 - heuristic; -- default
|
||||
-- set optimizer_prune_level=0 - exhaustive;
|
||||
-- set optimizer_prune_level=1 - heuristic; -- default
|
||||
|
||||
|
||||
#
|
||||
@ -167,8 +167,8 @@ select @@heuristic;
|
||||
# procedure 'find_best'. Notice that 'find_best' does not depend on the
|
||||
# choice of heuristic.
|
||||
|
||||
set plan_search_depth=63;
|
||||
select @@plan_search_depth;
|
||||
set optimizer_search_depth=63;
|
||||
select @@optimizer_search_depth;
|
||||
|
||||
-- 6-table join, chain
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
@ -189,11 +189,11 @@ show status like 'Last_query_cost';
|
||||
|
||||
# Test the new optimization procedures
|
||||
|
||||
set heuristic=0;
|
||||
select @@heuristic;
|
||||
set optimizer_prune_level=0;
|
||||
select @@optimizer_prune_level;
|
||||
|
||||
set plan_search_depth=0;
|
||||
select @@plan_search_depth;
|
||||
set optimizer_search_depth=0;
|
||||
select @@optimizer_search_depth;
|
||||
|
||||
-- 6-table join, chain
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
@ -211,8 +211,8 @@ show status like 'Last_query_cost';
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
show status like 'Last_query_cost';
|
||||
|
||||
set plan_search_depth=1;
|
||||
select @@plan_search_depth;
|
||||
set optimizer_search_depth=1;
|
||||
select @@optimizer_search_depth;
|
||||
|
||||
-- 6-table join, chain
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
@ -230,8 +230,8 @@ show status like 'Last_query_cost';
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
show status like 'Last_query_cost';
|
||||
|
||||
set plan_search_depth=62;
|
||||
select @@plan_search_depth;
|
||||
set optimizer_search_depth=62;
|
||||
select @@optimizer_search_depth;
|
||||
|
||||
-- 6-table join, chain
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
@ -250,11 +250,11 @@ explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and
|
||||
show status like 'Last_query_cost';
|
||||
|
||||
|
||||
set heuristic=1;
|
||||
select @@heuristic;
|
||||
set optimizer_prune_level=1;
|
||||
select @@optimizer_prune_level;
|
||||
|
||||
set plan_search_depth=0;
|
||||
select @@plan_search_depth;
|
||||
set optimizer_search_depth=0;
|
||||
select @@optimizer_search_depth;
|
||||
|
||||
-- 6-table join, chain
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
@ -272,8 +272,8 @@ show status like 'Last_query_cost';
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
show status like 'Last_query_cost';
|
||||
|
||||
set plan_search_depth=1;
|
||||
select @@plan_search_depth;
|
||||
set optimizer_search_depth=1;
|
||||
select @@optimizer_search_depth;
|
||||
|
||||
-- 6-table join, chain
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
@ -291,8 +291,8 @@ show status like 'Last_query_cost';
|
||||
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
|
||||
show status like 'Last_query_cost';
|
||||
|
||||
set plan_search_depth=62;
|
||||
select @@plan_search_depth;
|
||||
set optimizer_search_depth=62;
|
||||
select @@optimizer_search_depth;
|
||||
|
||||
-- 6-table join, chain
|
||||
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
|
||||
|
Reference in New Issue
Block a user