From 07df2029a371de84b68dcfa8c29bac52ab29aa45 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 30 Jun 2022 15:43:58 +0300 Subject: [PATCH] Adjust cost for re-creating a row from the JOIN CACHE Creating a record from the join cache is faster than getting a row from the engine (less and simpler code to execute). Added JOIN_CACHE_ROW_COPY_COST_FACTOR (0.5 for now) as the factor to take this into account. This is multiplied with ROW_COPY_COST. Other things: - Added cost of copying rows to hash join, similar to join_cache joins. --- mysql-test/main/greedy_optimizer.result | 84 +-- mysql-test/main/opt_trace.result | 686 +++++++++--------- mysql-test/main/select_safe.result | 1 + mysql-test/main/select_safe.test | 1 + mysql-test/main/status.result | 2 +- mysql-test/main/subselect.result | 4 +- mysql-test/main/subselect4.result | 5 +- .../main/subselect_no_exists_to_in.result | 4 +- mysql-test/main/subselect_no_opts.result | 4 +- mysql-test/main/subselect_no_scache.result | 4 +- mysql-test/main/subselect_no_semijoin.result | 8 +- mysql-test/main/subselect_sj.result | 10 +- mysql-test/main/subselect_sj_jcl6.result | 12 +- sql/optimizer_costs.h | 7 + sql/sql_select.cc | 6 +- 15 files changed, 424 insertions(+), 414 deletions(-) diff --git a/mysql-test/main/greedy_optimizer.result b/mysql-test/main/greedy_optimizer.result index f424b5036a0..40add445c3c 100644 --- a/mysql-test/main/greedy_optimizer.result +++ b/mysql-test/main/greedy_optimizer.result @@ -127,7 +127,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2696.338350 +Last_query_cost 2445.013350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 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 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -139,7 +139,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2696.338350 +Last_query_cost 2445.013350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -151,7 +151,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1559.791393 +Last_query_cost 1330.797643 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -163,7 +163,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1559.791393 +Last_query_cost 1330.797643 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -175,7 +175,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1563.335143 +Last_query_cost 1334.341393 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -187,7 +187,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1563.335143 +Last_query_cost 1334.341393 set optimizer_prune_level=0; select @@optimizer_prune_level; @@optimizer_prune_level @@ -207,7 +207,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2693.038350 +Last_query_cost 2437.438350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 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 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -219,7 +219,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2693.038350 +Last_query_cost 2437.438350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -231,7 +231,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 751.472751 +Last_query_cost 653.372751 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -243,7 +243,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 751.472751 +Last_query_cost 653.372751 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -255,7 +255,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 760.922751 +Last_query_cost 662.822751 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -267,7 +267,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 760.922751 +Last_query_cost 662.822751 set optimizer_search_depth=1; select @@optimizer_search_depth; @@optimizer_search_depth @@ -283,7 +283,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2696.338350 +Last_query_cost 2445.013350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 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 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -295,7 +295,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2696.338350 +Last_query_cost 2445.013350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -307,7 +307,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2068.798851 +Last_query_cost 1762.798851 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -319,7 +319,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2068.798851 +Last_query_cost 1762.798851 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -331,7 +331,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2073.523851 +Last_query_cost 1767.523851 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -343,7 +343,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2073.523851 +Last_query_cost 1767.523851 set optimizer_search_depth=62; select @@optimizer_search_depth; @@optimizer_search_depth @@ -359,7 +359,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2693.038350 +Last_query_cost 2437.438350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 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 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -371,7 +371,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2693.038350 +Last_query_cost 2437.438350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -383,7 +383,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 751.472751 +Last_query_cost 653.372751 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -395,7 +395,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 751.472751 +Last_query_cost 653.372751 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -407,7 +407,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 760.922751 +Last_query_cost 662.822751 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -419,7 +419,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 760.922751 +Last_query_cost 662.822751 set optimizer_prune_level=2; select @@optimizer_prune_level; @@optimizer_prune_level @@ -439,7 +439,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2696.338350 +Last_query_cost 2445.013350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 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 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -451,7 +451,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2696.338350 +Last_query_cost 2445.013350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -463,7 +463,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1559.791393 +Last_query_cost 1330.797643 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -475,7 +475,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1559.791393 +Last_query_cost 1330.797643 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -487,7 +487,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1563.335143 +Last_query_cost 1334.341393 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -499,7 +499,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1563.335143 +Last_query_cost 1334.341393 set optimizer_search_depth=1; select @@optimizer_search_depth; @@optimizer_search_depth @@ -515,7 +515,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2696.338350 +Last_query_cost 2445.013350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 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 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -527,7 +527,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2696.338350 +Last_query_cost 2445.013350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -539,7 +539,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2068.798851 +Last_query_cost 1762.798851 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -551,7 +551,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2068.798851 +Last_query_cost 1762.798851 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -563,7 +563,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2073.523851 +Last_query_cost 1767.523851 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -575,7 +575,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2073.523851 +Last_query_cost 1767.523851 set optimizer_search_depth=62; select @@optimizer_search_depth; @@optimizer_search_depth @@ -591,7 +591,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2696.338350 +Last_query_cost 2445.013350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 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 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -603,7 +603,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2696.338350 +Last_query_cost 2445.013350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -615,7 +615,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1559.791393 +Last_query_cost 1330.797643 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -627,7 +627,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1559.791393 +Last_query_cost 1330.797643 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -639,7 +639,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1563.335143 +Last_query_cost 1334.341393 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; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -651,7 +651,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1563.335143 +Last_query_cost 1334.341393 drop table t1,t2,t3,t4,t5,t6,t7; CREATE TABLE t1 (a int, b int, d int, i int); INSERT INTO t1 VALUES (1,1,1,1); diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index f78d2d83adc..121794cde92 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -1205,7 +1205,7 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { "rows": 100, "rows_after_scan": 75, "rows_after_filter": 75, - "cost": 1901.158691, + "cost": 1807.408691, "index_only": false, "chosen": false } @@ -1259,7 +1259,7 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { "rows": 100, "rows_after_scan": 75, "rows_after_filter": 75, - "cost": 1901.158691, + "cost": 1807.408691, "index_only": false, "chosen": false } @@ -3405,7 +3405,7 @@ explain extended select * from t1 where a in (select pk from t10) { "rows": 10, "rows_after_scan": 10, "rows_after_filter": 10, - "cost": 11.01098633, + "cost": 10.63598633, "index_only": false, "chosen": true } @@ -3414,7 +3414,7 @@ explain extended select * from t1 where a in (select pk from t10) { "type": "scan", "records_read": 10, "records_out": 10, - "cost": 11.01098633, + "cost": 10.63598633, "uses_join_buffering": true } } @@ -3425,12 +3425,12 @@ explain extended select * from t1 where a in (select pk from t10) { "plan_prefix": ["t1"], "table": "t10", "rows_for_plan": 30, - "cost_for_plan": 12.76428223, + "cost_for_plan": 12.38928223, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 3, - "cost": 12.76428223 + "cost": 12.38928223 }, { "strategy": "SJ-Materialization", @@ -3440,10 +3440,10 @@ explain extended select * from t1 where a in (select pk from t10) { { "strategy": "DuplicateWeedout", "records": 3, - "dups_cost": 12.76428223, + "dups_cost": 12.38928223, "write_cost": 2.5, "full_lookup_cost": 15, - "total_cost": 30.26428223 + "total_cost": 29.88928223 }, { "chosen_strategy": "SJ-Materialization" @@ -5147,7 +5147,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 4.002563477, + "cost": 3.890063477, "index_only": false, "chosen": true } @@ -5156,7 +5156,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "type": "scan", "records_read": 3, "records_out": 3, - "cost": 4.002563477, + "cost": 3.890063477, "uses_join_buffering": true } } @@ -5167,7 +5167,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "plan_prefix": ["t_inner_1"], "table": "t_inner_2", "rows_for_plan": 9, - "cost_for_plan": 5.755126953 + "cost_for_plan": 5.642626953 } ] }, @@ -5290,7 +5290,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 4.002563477, + "cost": 3.890063477, "index_only": false, "chosen": true } @@ -5299,7 +5299,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "type": "scan", "records_read": 3, "records_out": 3, - "cost": 4.002563477, + "cost": 3.890063477, "uses_join_buffering": true } } @@ -5316,7 +5316,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 4.002563477, + "cost": 3.890063477, "index_only": false, "chosen": true } @@ -5325,7 +5325,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "type": "scan", "records_read": 3, "records_out": 3, - "cost": 4.002563477, + "cost": 3.890063477, "uses_join_buffering": true } } @@ -5336,7 +5336,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "plan_prefix": ["t1"], "table": "t_inner_1", "rows_for_plan": 9, - "cost_for_plan": 5.755126953, + "cost_for_plan": 5.642626953, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -5354,7 +5354,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 9.852563477, + "cost": 9.177563477, "index_only": false, "chosen": true } @@ -5363,7 +5363,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "type": "scan", "records_read": 3, "records_out": 3, - "cost": 9.852563477, + "cost": 9.177563477, "uses_join_buffering": true } } @@ -5374,7 +5374,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "plan_prefix": ["t1", "t_inner_1"], "table": "t_inner_2", "rows_for_plan": 27, - "cost_for_plan": 15.60769043, + "cost_for_plan": 14.82019043, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", @@ -5384,15 +5384,15 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ { "strategy": "SJ-Materialization", "records": 3, - "cost": 10.75769043 + "cost": 10.64519043 }, { "strategy": "DuplicateWeedout", "records": 3, - "dups_cost": 15.60769043, + "dups_cost": 14.82019043, "write_cost": 1.45, "full_lookup_cost": 4.05, - "total_cost": 21.10769043 + "total_cost": 20.32019043 }, { "chosen_strategy": "SJ-Materialization" @@ -5405,7 +5405,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "plan_prefix": ["t1"], "table": "t_inner_2", "rows_for_plan": 9, - "cost_for_plan": 5.755126953, + "cost_for_plan": 5.642626953, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -5447,7 +5447,7 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ { "best_join_order": ["t1", ""], "rows": 3, - "cost": 10.75769043 + "cost": 10.64519043 }, { "substitute_best_equal": { @@ -5908,7 +5908,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 4.002563477, + "cost": 3.890063477, "index_only": false, "chosen": true } @@ -5917,7 +5917,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 4.002563477, + "cost": 3.890063477, "uses_join_buffering": true } } @@ -5934,7 +5934,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 10.00769043, + "cost": 9.67019043, "index_only": false, "chosen": true } @@ -5943,7 +5943,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 10.00769043, + "cost": 9.67019043, "uses_join_buffering": true } } @@ -5960,7 +5960,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 10.00769043, + "cost": 9.67019043, "index_only": false, "chosen": true } @@ -5969,7 +5969,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 10.00769043, + "cost": 9.67019043, "uses_join_buffering": true } } @@ -5986,7 +5986,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 4.002563477, + "cost": 3.890063477, "index_only": false, "chosen": true } @@ -5995,7 +5995,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 4.002563477, + "cost": 3.890063477, "uses_join_buffering": true } } @@ -6012,7 +6012,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 10.00769043, + "cost": 9.67019043, "index_only": false, "chosen": true } @@ -6021,7 +6021,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 10.00769043, + "cost": 9.67019043, "uses_join_buffering": true } } @@ -6032,7 +6032,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_outer_2", "rows_for_plan": 27, - "cost_for_plan": 11.76025391, + "cost_for_plan": 11.42275391, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -6050,7 +6050,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 76.15769043, + "cost": 70.08269043, "index_only": false, "chosen": true } @@ -6059,7 +6059,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 76.15769043, + "cost": 70.08269043, "uses_join_buffering": true } } @@ -6076,7 +6076,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 26.05256348, + "cost": 24.02756348, "index_only": false, "chosen": true } @@ -6085,7 +6085,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 26.05256348, + "cost": 24.02756348, "uses_join_buffering": true } } @@ -6102,7 +6102,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 26.05256348, + "cost": 24.02756348, "index_only": false, "chosen": true } @@ -6111,7 +6111,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 26.05256348, + "cost": 24.02756348, "uses_join_buffering": true } } @@ -6128,7 +6128,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 76.15769043, + "cost": 70.08269043, "index_only": false, "chosen": true } @@ -6137,7 +6137,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 76.15769043, + "cost": 70.08269043, "uses_join_buffering": true } } @@ -6148,7 +6148,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2"], "table": "t_inner_1", "rows_for_plan": 81, - "cost_for_plan": 37.81281738, + "cost_for_plan": 35.45031738, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -6166,7 +6166,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 258.4076904, + "cost": 231.0701904, "index_only": false, "chosen": true } @@ -6175,7 +6175,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 258.4076904, + "cost": 231.0701904, "uses_join_buffering": true } } @@ -6192,7 +6192,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 86.80256348, + "cost": 77.69006348, "index_only": false, "chosen": true } @@ -6201,7 +6201,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 86.80256348, + "cost": 77.69006348, "uses_join_buffering": true } } @@ -6218,7 +6218,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 258.4076904, + "cost": 231.0701904, "index_only": false, "chosen": true } @@ -6227,7 +6227,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 258.4076904, + "cost": 231.0701904, "uses_join_buffering": true } } @@ -6238,20 +6238,20 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"], "table": "t_inner_2", "rows_for_plan": 729, - "cost_for_plan": 296.2205078, + "cost_for_plan": 266.5205078, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 27, - "cost": 322.9523926 + "cost": 322.6148926 }, { "strategy": "DuplicateWeedout", "records": 27, - "dups_cost": 296.2205078, + "dups_cost": 266.5205078, "write_cost": 5.05, "full_lookup_cost": 109.35, - "total_cost": 410.6205078 + "total_cost": 380.9205078 }, { "chosen_strategy": "FirstMatch" @@ -6278,7 +6278,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 34.15256348, + "cost": 30.10256348, "index_only": false, "chosen": true } @@ -6287,7 +6287,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 34.15256348, + "cost": 30.10256348, "uses_join_buffering": true } } @@ -6304,7 +6304,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 100.4576904, + "cost": 88.30769043, "index_only": false, "chosen": true } @@ -6313,7 +6313,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 100.4576904, + "cost": 88.30769043, "uses_join_buffering": true } } @@ -6329,7 +6329,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_4", "rows_for_plan": 81, - "cost_for_plan": 357.1049561, + "cost_for_plan": 352.7174561, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -6353,7 +6353,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 331.3076904, + "cost": 285.7451904, "index_only": false, "chosen": true } @@ -6362,7 +6362,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 331.3076904, + "cost": 285.7451904, "uses_join_buffering": true } } @@ -6379,20 +6379,20 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 729, - "cost_for_plan": 688.4126465, + "cost_for_plan": 638.4626465, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 27, - "cost": 634.1445312 + "cost": 633.8070313 }, { "strategy": "DuplicateWeedout", "records": 27, - "dups_cost": 688.4126465, + "dups_cost": 638.4626465, "write_cost": 5.05, "full_lookup_cost": 109.35, - "total_cost": 802.8126465 + "total_cost": 752.8626465 }, { "chosen_strategy": "FirstMatch" @@ -6410,7 +6410,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 243, - "cost_for_plan": 423.410083, + "cost_for_plan": 410.922583, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -6420,7 +6420,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"], "table": "t_inner_4", "rows_for_plan": 243, - "cost_for_plan": 124.6153809, + "cost_for_plan": 113.1403809, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -6443,7 +6443,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 878.0576904, + "cost": 768.7076904, "index_only": false, "chosen": true } @@ -6452,7 +6452,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 878.0576904, + "cost": 768.7076904, "uses_join_buffering": true } } @@ -6469,7 +6469,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 878.0576904, + "cost": 768.7076904, "index_only": false, "chosen": true } @@ -6478,7 +6478,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 878.0576904, + "cost": 768.7076904, "uses_join_buffering": true } } @@ -6494,11 +6494,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_2", "rows_for_plan": 2187, - "cost_for_plan": 1002.673071, + "cost_for_plan": 881.8480713, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 1002.673071, - "best_cost": 634.1446312 + "current_cost": 881.8480713, + "best_cost": 633.8071312 }, { "plan_prefix": [ @@ -6509,11 +6509,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 2187, - "cost_for_plan": 1002.673071, + "cost_for_plan": 881.8480713, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 1002.673071, - "best_cost": 634.1446312 + "current_cost": 881.8480713, + "best_cost": 633.8071312 } ] }, @@ -6521,7 +6521,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"], "table": "t_inner_3", "rows_for_plan": 729, - "cost_for_plan": 296.2205078, + "cost_for_plan": 266.5205078, "semijoin_strategy_choice": [], "pruned_by_heuristic": "min_read_time" } @@ -6531,7 +6531,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2"], "table": "t_inner_2", "rows_for_plan": 243, - "cost_for_plan": 87.91794434, + "cost_for_plan": 81.50544434, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -6539,7 +6539,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2"], "table": "t_inner_4", "rows_for_plan": 81, - "cost_for_plan": 37.81281738, + "cost_for_plan": 35.45031738, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -6547,7 +6547,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2"], "table": "t_inner_3", "rows_for_plan": 243, - "cost_for_plan": 87.91794434, + "cost_for_plan": 81.50544434, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -6557,7 +6557,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_1", "rows_for_plan": 9, - "cost_for_plan": 5.755126953, + "cost_for_plan": 5.642626953, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -6575,7 +6575,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 27.55769043, + "cost": 25.53269043, "index_only": false, "chosen": true } @@ -6584,7 +6584,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 27.55769043, + "cost": 25.53269043, "uses_join_buffering": true } } @@ -6601,7 +6601,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 27.55769043, + "cost": 25.53269043, "index_only": false, "chosen": true } @@ -6610,7 +6610,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 27.55769043, + "cost": 25.53269043, "uses_join_buffering": true } } @@ -6627,7 +6627,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 9.852563477, + "cost": 9.177563477, "index_only": false, "chosen": true } @@ -6636,7 +6636,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 9.852563477, + "cost": 9.177563477, "uses_join_buffering": true } } @@ -6653,7 +6653,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 27.55769043, + "cost": 25.53269043, "index_only": false, "chosen": true } @@ -6662,7 +6662,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 27.55769043, + "cost": 25.53269043, "uses_join_buffering": true } } @@ -6673,7 +6673,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_outer_2", "rows_for_plan": 81, - "cost_for_plan": 33.31281738, + "cost_for_plan": 31.17531738, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -6691,7 +6691,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 258.4076904, + "cost": 231.0701904, "index_only": false, "chosen": true } @@ -6700,7 +6700,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 258.4076904, + "cost": 231.0701904, "uses_join_buffering": true } } @@ -6717,7 +6717,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 86.80256348, + "cost": 77.69006348, "index_only": false, "chosen": true } @@ -6726,7 +6726,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 86.80256348, + "cost": 77.69006348, "uses_join_buffering": true } } @@ -6743,7 +6743,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 258.4076904, + "cost": 231.0701904, "index_only": false, "chosen": true } @@ -6752,7 +6752,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 258.4076904, + "cost": 231.0701904, "uses_join_buffering": true } } @@ -6763,15 +6763,15 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"], "table": "t_inner_2", "rows_for_plan": 729, - "cost_for_plan": 291.7205078, + "cost_for_plan": 262.2455078, "semijoin_strategy_choice": [ { "strategy": "DuplicateWeedout", "records": 27, - "dups_cost": 291.7205078, + "dups_cost": 262.2455078, "write_cost": 5.05, "full_lookup_cost": 109.35, - "total_cost": 406.1205078 + "total_cost": 376.6455078 }, { "chosen_strategy": "DuplicateWeedout" @@ -6798,7 +6798,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 34.15256348, + "cost": 30.10256348, "index_only": false, "chosen": true } @@ -6807,7 +6807,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 34.15256348, + "cost": 30.10256348, "uses_join_buffering": true } } @@ -6824,7 +6824,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 100.4576904, + "cost": 88.30769043, "index_only": false, "chosen": true } @@ -6833,7 +6833,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 100.4576904, + "cost": 88.30769043, "uses_join_buffering": true } } @@ -6849,7 +6849,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_4", "rows_for_plan": 81, - "cost_for_plan": 440.2730713, + "cost_for_plan": 406.7480713, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -6873,7 +6873,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 331.3076904, + "cost": 285.7451904, "index_only": false, "chosen": true } @@ -6882,7 +6882,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 331.3076904, + "cost": 285.7451904, "uses_join_buffering": true } } @@ -6899,28 +6899,28 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 729, - "cost_for_plan": 771.5807617, + "cost_for_plan": 692.4932617, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 27, - "cost": 717.3126465 + "cost": 687.8376465 }, { "strategy": "DuplicateWeedout", "records": 27, - "dups_cost": 771.5807617, + "dups_cost": 692.4932617, "write_cost": 5.05, "full_lookup_cost": 109.35, - "total_cost": 885.9807617 + "total_cost": 806.8932617 }, { "chosen_strategy": "FirstMatch" } ], "pruned_by_cost": true, - "current_cost": 717.3126465, - "best_cost": 634.1446312 + "current_cost": 687.8376465, + "best_cost": 633.8071312 } ] }, @@ -6933,7 +6933,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 243, - "cost_for_plan": 506.5781982, + "cost_for_plan": 464.9531982, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -6943,7 +6943,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"], "table": "t_inner_4", "rows_for_plan": 243, - "cost_for_plan": 120.1153809, + "cost_for_plan": 108.8653809, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -6966,7 +6966,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 878.0576904, + "cost": 768.7076904, "index_only": false, "chosen": true } @@ -6975,7 +6975,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 878.0576904, + "cost": 768.7076904, "uses_join_buffering": true } } @@ -6992,7 +6992,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 878.0576904, + "cost": 768.7076904, "index_only": false, "chosen": true } @@ -7001,7 +7001,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 878.0576904, + "cost": 768.7076904, "uses_join_buffering": true } } @@ -7017,11 +7017,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_2", "rows_for_plan": 2187, - "cost_for_plan": 998.1730713, + "cost_for_plan": 877.5730713, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 998.1730713, - "best_cost": 634.1446312 + "current_cost": 877.5730713, + "best_cost": 633.8071312 }, { "plan_prefix": [ @@ -7032,11 +7032,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 2187, - "cost_for_plan": 998.1730713, + "cost_for_plan": 877.5730713, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 998.1730713, - "best_cost": 634.1446312 + "current_cost": 877.5730713, + "best_cost": 633.8071312 } ] }, @@ -7044,7 +7044,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"], "table": "t_inner_3", "rows_for_plan": 729, - "cost_for_plan": 291.7205078, + "cost_for_plan": 262.2455078, "semijoin_strategy_choice": [], "pruned_by_heuristic": "min_read_time" } @@ -7054,7 +7054,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_2", "rows_for_plan": 81, - "cost_for_plan": 33.31281738, + "cost_for_plan": 31.17531738, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", @@ -7064,10 +7064,10 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { { "strategy": "DuplicateWeedout", "records": 3, - "dups_cost": 33.31281738, + "dups_cost": 31.17531738, "write_cost": 1.45, "full_lookup_cost": 12.15, - "total_cost": 46.91281738 + "total_cost": 44.77531738 }, { "chosen_strategy": "FirstMatch" @@ -7089,7 +7089,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 12.70769043, + "cost": 11.69519043, "index_only": false, "chosen": true } @@ -7098,7 +7098,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 12.70769043, + "cost": 11.69519043, "uses_join_buffering": true } } @@ -7115,7 +7115,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 4.902563477, + "cost": 4.565063477, "index_only": false, "chosen": true } @@ -7124,7 +7124,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 4.902563477, + "cost": 4.565063477, "uses_join_buffering": true } } @@ -7141,7 +7141,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 12.70769043, + "cost": 11.69519043, "index_only": false, "chosen": true } @@ -7150,7 +7150,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 12.70769043, + "cost": 11.69519043, "uses_join_buffering": true } } @@ -7161,7 +7161,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_outer_2", "rows_for_plan": 27, - "cost_for_plan": 49.0371582, + "cost_for_plan": 48.0246582, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -7184,7 +7184,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 34.15256348, + "cost": 30.10256348, "index_only": false, "chosen": true } @@ -7193,7 +7193,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 34.15256348, + "cost": 30.10256348, "uses_join_buffering": true } } @@ -7210,7 +7210,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 100.4576904, + "cost": 88.30769043, "index_only": false, "chosen": true } @@ -7219,7 +7219,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 100.4576904, + "cost": 88.30769043, "uses_join_buffering": true } } @@ -7235,7 +7235,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_4", "rows_for_plan": 81, - "cost_for_plan": 83.18972168, + "cost_for_plan": 78.12722168, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -7259,7 +7259,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 331.3076904, + "cost": 285.7451904, "index_only": false, "chosen": true } @@ -7268,7 +7268,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 331.3076904, + "cost": 285.7451904, "uses_join_buffering": true } } @@ -7285,20 +7285,20 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 729, - "cost_for_plan": 414.4974121, + "cost_for_plan": 363.8724121, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 27, - "cost": 360.2292969 + "cost": 359.2167969 }, { "strategy": "DuplicateWeedout", "records": 27, - "dups_cost": 414.4974121, + "dups_cost": 363.8724121, "write_cost": 5.05, "full_lookup_cost": 109.35, - "total_cost": 528.8974121 + "total_cost": 478.2724121 }, { "chosen_strategy": "FirstMatch" @@ -7316,7 +7316,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 243, - "cost_for_plan": 149.4948486, + "cost_for_plan": 136.3323486, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -7326,7 +7326,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_inner_4", "rows_for_plan": 9, - "cost_for_plan": 41.23203125, + "cost_for_plan": 40.89453125, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -7349,7 +7349,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 35.65769043, + "cost": 31.60769043, "index_only": false, "chosen": true } @@ -7358,7 +7358,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 35.65769043, + "cost": 31.60769043, "uses_join_buffering": true } } @@ -7375,7 +7375,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 35.65769043, + "cost": 31.60769043, "index_only": false, "chosen": true } @@ -7384,7 +7384,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 35.65769043, + "cost": 31.60769043, "uses_join_buffering": true } } @@ -7400,7 +7400,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_outer_2", "rows_for_plan": 81, - "cost_for_plan": 76.88972168, + "cost_for_plan": 72.50222168, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -7424,7 +7424,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 331.3076904, + "cost": 285.7451904, "index_only": false, "chosen": true } @@ -7433,7 +7433,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 331.3076904, + "cost": 285.7451904, "uses_join_buffering": true } } @@ -7450,23 +7450,23 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 729, - "cost_for_plan": 408.1974121, + "cost_for_plan": 358.2474121, "semijoin_strategy_choice": [ { "strategy": "DuplicateWeedout", "records": 27, - "dups_cost": 408.1974121, + "dups_cost": 358.2474121, "write_cost": 5.05, "full_lookup_cost": 109.35, - "total_cost": 522.5974121 + "total_cost": 472.6474121 }, { "chosen_strategy": "DuplicateWeedout" } ], "pruned_by_cost": true, - "current_cost": 522.5974121, - "best_cost": 360.2293969 + "current_cost": 472.6474121, + "best_cost": 359.2168969 } ] }, @@ -7479,7 +7479,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 81, - "cost_for_plan": 76.88972168, + "cost_for_plan": 72.50222168, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -7489,7 +7489,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_inner_3", "rows_for_plan": 27, - "cost_for_plan": 49.0371582, + "cost_for_plan": 48.0246582, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -7499,7 +7499,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_4", "rows_for_plan": 27, - "cost_for_plan": 15.60769043, + "cost_for_plan": 14.82019043, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -7517,7 +7517,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 88.30769043, + "cost": 79.19519043, "index_only": false, "chosen": true } @@ -7526,7 +7526,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 88.30769043, + "cost": 79.19519043, "uses_join_buffering": true } } @@ -7543,7 +7543,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 88.30769043, + "cost": 79.19519043, "index_only": false, "chosen": true } @@ -7552,7 +7552,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 88.30769043, + "cost": 79.19519043, "uses_join_buffering": true } } @@ -7569,7 +7569,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 88.30769043, + "cost": 79.19519043, "index_only": false, "chosen": true } @@ -7578,7 +7578,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 88.30769043, + "cost": 79.19519043, "uses_join_buffering": true } } @@ -7589,7 +7589,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], "table": "t_outer_2", "rows_for_plan": 243, - "cost_for_plan": 103.9153809, + "cost_for_plan": 94.01538086, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -7612,7 +7612,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 878.0576904, + "cost": 768.7076904, "index_only": false, "chosen": true } @@ -7621,7 +7621,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 878.0576904, + "cost": 768.7076904, "uses_join_buffering": true } } @@ -7638,7 +7638,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 878.0576904, + "cost": 768.7076904, "index_only": false, "chosen": true } @@ -7647,7 +7647,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 878.0576904, + "cost": 768.7076904, "uses_join_buffering": true } } @@ -7663,11 +7663,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_2", "rows_for_plan": 2187, - "cost_for_plan": 981.9730713, + "cost_for_plan": 862.7230713, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 981.9730713, - "best_cost": 360.2293969 + "current_cost": 862.7230713, + "best_cost": 359.2168969 }, { "plan_prefix": [ @@ -7678,11 +7678,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 2187, - "cost_for_plan": 981.9730713, + "cost_for_plan": 862.7230713, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 981.9730713, - "best_cost": 360.2293969 + "current_cost": 862.7230713, + "best_cost": 359.2168969 } ] }, @@ -7690,7 +7690,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], "table": "t_inner_2", "rows_for_plan": 243, - "cost_for_plan": 103.9153809, + "cost_for_plan": 94.01538086, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7698,7 +7698,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], "table": "t_inner_3", "rows_for_plan": 243, - "cost_for_plan": 103.9153809, + "cost_for_plan": 94.01538086, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -7708,7 +7708,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_3", "rows_for_plan": 81, - "cost_for_plan": 33.31281738, + "cost_for_plan": 31.17531738, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -7718,7 +7718,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_2", "rows_for_plan": 27, - "cost_for_plan": 11.76025391, + "cost_for_plan": 11.42275391, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7726,7 +7726,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_4", "rows_for_plan": 9, - "cost_for_plan": 5.755126953, + "cost_for_plan": 5.642626953, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7734,7 +7734,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_3", "rows_for_plan": 27, - "cost_for_plan": 11.76025391, + "cost_for_plan": 11.42275391, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -7914,7 +7914,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "t_inner_3" ], "rows": 27, - "cost": 360.2292969 + "cost": 359.2167969 }, { "substitute_best_equal": { @@ -8273,7 +8273,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 10.00769043, + "cost": 9.67019043, "index_only": false, "chosen": true } @@ -8282,7 +8282,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 10.00769043, + "cost": 9.67019043, "uses_join_buffering": true } } @@ -8293,7 +8293,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_inner_1"], "table": "t_inner_2", "rows_for_plan": 27, - "cost_for_plan": 11.76025391 + "cost_for_plan": 11.42275391 } ] }, @@ -8386,7 +8386,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 10.00769043, + "cost": 9.67019043, "index_only": false, "chosen": true } @@ -8395,7 +8395,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 10.00769043, + "cost": 9.67019043, "uses_join_buffering": true } } @@ -8406,7 +8406,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_inner_4"], "table": "t_inner_3", "rows_for_plan": 27, - "cost_for_plan": 11.76025391 + "cost_for_plan": 11.42275391 } ] }, @@ -8607,7 +8607,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 4.002563477, + "cost": 3.890063477, "index_only": false, "chosen": true } @@ -8616,7 +8616,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 4.002563477, + "cost": 3.890063477, "uses_join_buffering": true } } @@ -8633,7 +8633,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 10.00769043, + "cost": 9.67019043, "index_only": false, "chosen": true } @@ -8642,7 +8642,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 10.00769043, + "cost": 9.67019043, "uses_join_buffering": true } } @@ -8659,7 +8659,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 10.00769043, + "cost": 9.67019043, "index_only": false, "chosen": true } @@ -8668,7 +8668,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 10.00769043, + "cost": 9.67019043, "uses_join_buffering": true } } @@ -8685,7 +8685,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 4.002563477, + "cost": 3.890063477, "index_only": false, "chosen": true } @@ -8694,7 +8694,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 4.002563477, + "cost": 3.890063477, "uses_join_buffering": true } } @@ -8711,7 +8711,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 10.00769043, + "cost": 9.67019043, "index_only": false, "chosen": true } @@ -8720,7 +8720,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 10.00769043, + "cost": 9.67019043, "uses_join_buffering": true } } @@ -8731,7 +8731,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_outer_2", "rows_for_plan": 27, - "cost_for_plan": 11.76025391, + "cost_for_plan": 11.42275391, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -8749,7 +8749,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 76.15769043, + "cost": 70.08269043, "index_only": false, "chosen": true } @@ -8758,7 +8758,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 76.15769043, + "cost": 70.08269043, "uses_join_buffering": true } } @@ -8775,7 +8775,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 26.05256348, + "cost": 24.02756348, "index_only": false, "chosen": true } @@ -8784,7 +8784,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 26.05256348, + "cost": 24.02756348, "uses_join_buffering": true } } @@ -8801,7 +8801,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 26.05256348, + "cost": 24.02756348, "index_only": false, "chosen": true } @@ -8810,7 +8810,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 26.05256348, + "cost": 24.02756348, "uses_join_buffering": true } } @@ -8827,7 +8827,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 76.15769043, + "cost": 70.08269043, "index_only": false, "chosen": true } @@ -8836,7 +8836,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 76.15769043, + "cost": 70.08269043, "uses_join_buffering": true } } @@ -8847,7 +8847,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2"], "table": "t_inner_1", "rows_for_plan": 81, - "cost_for_plan": 37.81281738, + "cost_for_plan": 35.45031738, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -8865,7 +8865,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 258.4076904, + "cost": 231.0701904, "index_only": false, "chosen": true } @@ -8874,7 +8874,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 258.4076904, + "cost": 231.0701904, "uses_join_buffering": true } } @@ -8891,7 +8891,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 86.80256348, + "cost": 77.69006348, "index_only": false, "chosen": true } @@ -8900,7 +8900,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 86.80256348, + "cost": 77.69006348, "uses_join_buffering": true } } @@ -8917,7 +8917,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 258.4076904, + "cost": 231.0701904, "index_only": false, "chosen": true } @@ -8926,7 +8926,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 258.4076904, + "cost": 231.0701904, "uses_join_buffering": true } } @@ -8937,25 +8937,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"], "table": "t_inner_2", "rows_for_plan": 729, - "cost_for_plan": 296.2205078, + "cost_for_plan": 266.5205078, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 27, - "cost": 322.9523926 + "cost": 322.6148926 }, { "strategy": "SJ-Materialization", "records": 27, - "cost": 36.67050781 + "cost": 35.99550781 }, { "strategy": "DuplicateWeedout", "records": 27, - "dups_cost": 296.2205078, + "dups_cost": 266.5205078, "write_cost": 5.05, "full_lookup_cost": 109.35, - "total_cost": 410.6205078 + "total_cost": 380.9205078 }, { "chosen_strategy": "SJ-Materialization" @@ -8982,7 +8982,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 34.15256348, + "cost": 30.10256348, "index_only": false, "chosen": true } @@ -8991,7 +8991,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 34.15256348, + "cost": 30.10256348, "uses_join_buffering": true } } @@ -9008,7 +9008,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 100.4576904, + "cost": 88.30769043, "index_only": false, "chosen": true } @@ -9017,7 +9017,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 100.4576904, + "cost": 88.30769043, "uses_join_buffering": true } } @@ -9033,7 +9033,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_4", "rows_for_plan": 81, - "cost_for_plan": 70.82307129, + "cost_for_plan": 66.09807129, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -9057,7 +9057,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 331.3076904, + "cost": 285.7451904, "index_only": false, "chosen": true } @@ -9066,7 +9066,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 331.3076904, + "cost": 285.7451904, "uses_join_buffering": true } } @@ -9083,25 +9083,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 729, - "cost_for_plan": 402.1307617, + "cost_for_plan": 351.8432617, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 27, - "cost": 347.8626465 + "cost": 347.1876465 }, { "strategy": "SJ-Materialization", "records": 27, - "cost": 61.58076172 + "cost": 60.56826172 }, { "strategy": "DuplicateWeedout", "records": 27, - "dups_cost": 402.1307617, + "dups_cost": 351.8432617, "write_cost": 5.05, "full_lookup_cost": 109.35, - "total_cost": 516.5307617 + "total_cost": 466.2432617 }, { "chosen_strategy": "SJ-Materialization" @@ -9119,11 +9119,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 243, - "cost_for_plan": 137.1281982, + "cost_for_plan": 124.3031982, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 137.1281982, - "best_cost": 61.58086172 + "current_cost": 124.3031982, + "best_cost": 60.56836172 } ] }, @@ -9131,21 +9131,21 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"], "table": "t_inner_4", "rows_for_plan": 243, - "cost_for_plan": 124.6153809, + "cost_for_plan": 113.1403809, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 124.6153809, - "best_cost": 61.58086172 + "current_cost": 113.1403809, + "best_cost": 60.56836172 }, { "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"], "table": "t_inner_3", "rows_for_plan": 729, - "cost_for_plan": 296.2205078, + "cost_for_plan": 266.5205078, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 296.2205078, - "best_cost": 61.58086172 + "current_cost": 266.5205078, + "best_cost": 60.56836172 } ] }, @@ -9153,17 +9153,17 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2"], "table": "t_inner_2", "rows_for_plan": 243, - "cost_for_plan": 87.91794434, + "cost_for_plan": 81.50544434, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 87.91794434, - "best_cost": 61.58086172 + "current_cost": 81.50544434, + "best_cost": 60.56836172 }, { "plan_prefix": ["t_outer_1", "t_outer_2"], "table": "t_inner_4", "rows_for_plan": 81, - "cost_for_plan": 37.81281738, + "cost_for_plan": 35.45031738, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -9171,11 +9171,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_outer_2"], "table": "t_inner_3", "rows_for_plan": 243, - "cost_for_plan": 87.91794434, + "cost_for_plan": 81.50544434, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 87.91794434, - "best_cost": 61.58086172 + "current_cost": 81.50544434, + "best_cost": 60.56836172 } ] }, @@ -9183,7 +9183,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_1", "rows_for_plan": 9, - "cost_for_plan": 5.755126953, + "cost_for_plan": 5.642626953, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -9201,7 +9201,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 27.55769043, + "cost": 25.53269043, "index_only": false, "chosen": true } @@ -9210,7 +9210,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 27.55769043, + "cost": 25.53269043, "uses_join_buffering": true } } @@ -9227,7 +9227,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 27.55769043, + "cost": 25.53269043, "index_only": false, "chosen": true } @@ -9236,7 +9236,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 27.55769043, + "cost": 25.53269043, "uses_join_buffering": true } } @@ -9253,7 +9253,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 9.852563477, + "cost": 9.177563477, "index_only": false, "chosen": true } @@ -9262,7 +9262,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 9.852563477, + "cost": 9.177563477, "uses_join_buffering": true } } @@ -9279,7 +9279,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 27.55769043, + "cost": 25.53269043, "index_only": false, "chosen": true } @@ -9288,7 +9288,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 27.55769043, + "cost": 25.53269043, "uses_join_buffering": true } } @@ -9299,7 +9299,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_outer_2", "rows_for_plan": 81, - "cost_for_plan": 33.31281738, + "cost_for_plan": 31.17531738, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -9317,7 +9317,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 258.4076904, + "cost": 231.0701904, "index_only": false, "chosen": true } @@ -9326,7 +9326,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 258.4076904, + "cost": 231.0701904, "uses_join_buffering": true } } @@ -9343,7 +9343,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 86.80256348, + "cost": 77.69006348, "index_only": false, "chosen": true } @@ -9352,7 +9352,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 86.80256348, + "cost": 77.69006348, "uses_join_buffering": true } } @@ -9369,7 +9369,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 258.4076904, + "cost": 231.0701904, "index_only": false, "chosen": true } @@ -9378,7 +9378,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 258.4076904, + "cost": 231.0701904, "uses_join_buffering": true } } @@ -9389,43 +9389,43 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"], "table": "t_inner_2", "rows_for_plan": 729, - "cost_for_plan": 291.7205078, + "cost_for_plan": 262.2455078, "semijoin_strategy_choice": [ { "strategy": "DuplicateWeedout", "records": 27, - "dups_cost": 291.7205078, + "dups_cost": 262.2455078, "write_cost": 5.05, "full_lookup_cost": 109.35, - "total_cost": 406.1205078 + "total_cost": 376.6455078 }, { "chosen_strategy": "DuplicateWeedout" } ], "pruned_by_cost": true, - "current_cost": 406.1205078, - "best_cost": 61.58086172 + "current_cost": 376.6455078, + "best_cost": 60.56836172 }, { "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"], "table": "t_inner_4", "rows_for_plan": 243, - "cost_for_plan": 120.1153809, + "cost_for_plan": 108.8653809, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 120.1153809, - "best_cost": 61.58086172 + "current_cost": 108.8653809, + "best_cost": 60.56836172 }, { "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"], "table": "t_inner_3", "rows_for_plan": 729, - "cost_for_plan": 291.7205078, + "cost_for_plan": 262.2455078, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 291.7205078, - "best_cost": 61.58086172 + "current_cost": 262.2455078, + "best_cost": 60.56836172 } ] }, @@ -9433,7 +9433,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_2", "rows_for_plan": 81, - "cost_for_plan": 33.31281738, + "cost_for_plan": 31.17531738, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", @@ -9443,15 +9443,15 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { { "strategy": "SJ-Materialization", "records": 3, - "cost": 19.46281738 + "cost": 19.12531738 }, { "strategy": "DuplicateWeedout", "records": 3, - "dups_cost": 33.31281738, + "dups_cost": 31.17531738, "write_cost": 1.45, "full_lookup_cost": 12.15, - "total_cost": 46.91281738 + "total_cost": 44.77531738 }, { "chosen_strategy": "SJ-Materialization" @@ -9473,7 +9473,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 12.70769043, + "cost": 11.69519043, "index_only": false, "chosen": true } @@ -9482,7 +9482,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 12.70769043, + "cost": 11.69519043, "uses_join_buffering": true } } @@ -9499,7 +9499,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 4.902563477, + "cost": 4.565063477, "index_only": false, "chosen": true } @@ -9508,7 +9508,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 4.902563477, + "cost": 4.565063477, "uses_join_buffering": true } } @@ -9525,7 +9525,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 12.70769043, + "cost": 11.69519043, "index_only": false, "chosen": true } @@ -9534,7 +9534,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 12.70769043, + "cost": 11.69519043, "uses_join_buffering": true } } @@ -9545,7 +9545,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_outer_2", "rows_for_plan": 27, - "cost_for_plan": 32.17050781, + "cost_for_plan": 30.82050781, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -9568,7 +9568,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 3, "rows_after_scan": 3, "rows_after_filter": 3, - "cost": 34.15256348, + "cost": 30.10256348, "index_only": false, "chosen": true } @@ -9577,7 +9577,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 3, "records_out": 3, - "cost": 34.15256348, + "cost": 30.10256348, "uses_join_buffering": true } } @@ -9594,7 +9594,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 100.4576904, + "cost": 88.30769043, "index_only": false, "chosen": true } @@ -9603,7 +9603,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 100.4576904, + "cost": 88.30769043, "uses_join_buffering": true } } @@ -9619,11 +9619,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_4", "rows_for_plan": 81, - "cost_for_plan": 66.32307129, + "cost_for_plan": 60.92307129, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 66.32307129, - "best_cost": 61.58086172 + "current_cost": 60.92307129, + "best_cost": 60.56836172 }, { "plan_prefix": [ @@ -9634,11 +9634,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 243, - "cost_for_plan": 132.6281982, + "cost_for_plan": 119.1281982, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 132.6281982, - "best_cost": 61.58086172 + "current_cost": 119.1281982, + "best_cost": 60.56836172 } ] }, @@ -9646,7 +9646,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_inner_4", "rows_for_plan": 9, - "cost_for_plan": 24.36538086, + "cost_for_plan": 23.69038086, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -9669,7 +9669,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 35.65769043, + "cost": 31.60769043, "index_only": false, "chosen": true } @@ -9678,7 +9678,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 35.65769043, + "cost": 31.60769043, "uses_join_buffering": true } } @@ -9695,7 +9695,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 35.65769043, + "cost": 31.60769043, "index_only": false, "chosen": true } @@ -9704,7 +9704,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 35.65769043, + "cost": 31.60769043, "uses_join_buffering": true } } @@ -9720,7 +9720,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_outer_2", "rows_for_plan": 81, - "cost_for_plan": 60.02307129, + "cost_for_plan": 55.29807129, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -9744,7 +9744,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 331.3076904, + "cost": 285.7451904, "index_only": false, "chosen": true } @@ -9753,7 +9753,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 331.3076904, + "cost": 285.7451904, "uses_join_buffering": true } } @@ -9770,23 +9770,23 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 729, - "cost_for_plan": 391.3307617, + "cost_for_plan": 341.0432617, "semijoin_strategy_choice": [ { "strategy": "DuplicateWeedout", "records": 27, - "dups_cost": 391.3307617, + "dups_cost": 341.0432617, "write_cost": 5.05, "full_lookup_cost": 109.35, - "total_cost": 505.7307617 + "total_cost": 455.4432617 }, { "chosen_strategy": "DuplicateWeedout" } ], "pruned_by_cost": true, - "current_cost": 505.7307617, - "best_cost": 61.58086172 + "current_cost": 455.4432617, + "best_cost": 60.56836172 } ] }, @@ -9799,7 +9799,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "rows_for_plan": 81, - "cost_for_plan": 60.02307129, + "cost_for_plan": 55.29807129, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -9809,7 +9809,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_inner_3", "rows_for_plan": 27, - "cost_for_plan": 32.17050781, + "cost_for_plan": 30.82050781, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -9819,7 +9819,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_4", "rows_for_plan": 27, - "cost_for_plan": 15.60769043, + "cost_for_plan": 14.82019043, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -9837,7 +9837,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 88.30769043, + "cost": 79.19519043, "index_only": false, "chosen": true } @@ -9846,7 +9846,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 88.30769043, + "cost": 79.19519043, "uses_join_buffering": true } } @@ -9863,7 +9863,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 88.30769043, + "cost": 79.19519043, "index_only": false, "chosen": true } @@ -9872,7 +9872,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 88.30769043, + "cost": 79.19519043, "uses_join_buffering": true } } @@ -9889,7 +9889,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "rows": 9, "rows_after_scan": 9, "rows_after_filter": 9, - "cost": 88.30769043, + "cost": 79.19519043, "index_only": false, "chosen": true } @@ -9898,7 +9898,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "type": "scan", "records_read": 9, "records_out": 9, - "cost": 88.30769043, + "cost": 79.19519043, "uses_join_buffering": true } } @@ -9909,31 +9909,31 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], "table": "t_outer_2", "rows_for_plan": 243, - "cost_for_plan": 103.9153809, + "cost_for_plan": 94.01538086, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 103.9153809, - "best_cost": 61.58086172 + "current_cost": 94.01538086, + "best_cost": 60.56836172 }, { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], "table": "t_inner_2", "rows_for_plan": 243, - "cost_for_plan": 103.9153809, + "cost_for_plan": 94.01538086, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 103.9153809, - "best_cost": 61.58086172 + "current_cost": 94.01538086, + "best_cost": 60.56836172 }, { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], "table": "t_inner_3", "rows_for_plan": 243, - "cost_for_plan": 103.9153809, + "cost_for_plan": 94.01538086, "semijoin_strategy_choice": [], "pruned_by_cost": true, - "current_cost": 103.9153809, - "best_cost": 61.58086172 + "current_cost": 94.01538086, + "best_cost": 60.56836172 } ] }, @@ -9941,7 +9941,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_3", "rows_for_plan": 81, - "cost_for_plan": 33.31281738, + "cost_for_plan": 31.17531738, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -9951,7 +9951,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_2", "rows_for_plan": 27, - "cost_for_plan": 11.76025391, + "cost_for_plan": 11.42275391, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -9959,7 +9959,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_4", "rows_for_plan": 9, - "cost_for_plan": 5.755126953, + "cost_for_plan": 5.642626953, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -9967,7 +9967,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_3", "rows_for_plan": 27, - "cost_for_plan": 11.76025391, + "cost_for_plan": 11.42275391, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -10049,7 +10049,7 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "" ], "rows": 27, - "cost": 61.58076172 + "cost": 60.56826172 }, { "substitute_best_equal": { @@ -10867,7 +10867,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "rows": 1000, "rows_after_scan": 600, "rows_after_filter": 600, - "cost": 1752.098633, + "cost": 1677.098633, "index_only": false, "chosen": false } @@ -10957,9 +10957,9 @@ insert into t3 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); explain select * from t3 where (a,a) in (select t1.a, t2.a from t1, t2 where t1.b=t2.b); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 10 Using where -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 Using where +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 5 +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where +1 PRIMARY t3 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) select JSON_DETAILED(JSON_EXTRACT(trace, '$**.semijoin_table_pullout')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JSON_DETAILED(JSON_EXTRACT(trace, '$**.semijoin_table_pullout')) [ @@ -11119,7 +11119,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "rows": 100, "rows_after_scan": 75, "rows_after_filter": 75, - "cost": 213.6098633, + "cost": 204.2348633, "index_only": false, "chosen": false } @@ -12472,7 +12472,7 @@ explain format=json select * from three, t1 where t1.a=three.a and t1.b<5000 and "rows": 10000, "rows_after_scan": 323.0766, "rows_after_filter": 323.0766, - "cost": 2759.176591, + "cost": 2747.061218, "index_only": false, "chosen": false } diff --git a/mysql-test/main/select_safe.result b/mysql-test/main/select_safe.result index 90ed1a4e785..18fc31b8bdc 100644 --- a/mysql-test/main/select_safe.result +++ b/mysql-test/main/select_safe.result @@ -67,6 +67,7 @@ test.t1 analyze status OK insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); insert into t1 values (null,"b"),(null,"b"),(null,"c"),(null,"c"),(null,"d"),(null,"d"),(null,"e"),(null,"e"),(null,"a"),(null,"e"); insert into t1 values (null,"x"),(null,"x"),(null,"y"),(null,"y"),(null,"z"),(null,"z"),(null,"v"),(null,"v"),(null,"a"),(null,"v"); +set @@optimizer_where_cost=0.3; explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL b NULL NULL NULL 11 diff --git a/mysql-test/main/select_safe.test b/mysql-test/main/select_safe.test index c76e337cd10..b9788cf2eb2 100644 --- a/mysql-test/main/select_safe.test +++ b/mysql-test/main/select_safe.test @@ -60,6 +60,7 @@ analyze table t1; insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); insert into t1 values (null,"b"),(null,"b"),(null,"c"),(null,"c"),(null,"d"),(null,"d"),(null,"e"),(null,"e"),(null,"a"),(null,"e"); insert into t1 values (null,"x"),(null,"x"),(null,"y"),(null,"y"),(null,"z"),(null,"z"),(null,"v"),(null,"v"),(null,"a"),(null,"v"); +set @@optimizer_where_cost=0.3; explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; set MAX_SEEKS_FOR_KEY=1; explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; diff --git a/mysql-test/main/status.result b/mysql-test/main/status.result index de2c9d79dcd..78a39ee2ecf 100644 --- a/mysql-test/main/status.result +++ b/mysql-test/main/status.result @@ -173,7 +173,7 @@ a a 1 1 SHOW SESSION STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 4.003418 +Last_query_cost 3.953418 DROP TABLE t1; connect con1,localhost,root,,; show status like 'com_show_status'; diff --git a/mysql-test/main/subselect.result b/mysql-test/main/subselect.result index a5f4fa74df0..478404fcefe 100644 --- a/mysql-test/main/subselect.result +++ b/mysql-test/main/subselect.result @@ -7045,8 +7045,8 @@ SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY eq_ref distinct_key distinct_key 4 test.t2.c 1 +2 SUBQUERY ALL distinct_key NULL NULL NULL 1 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result index b6672e44915..48fe29344a5 100644 --- a/mysql-test/main/subselect4.result +++ b/mysql-test/main/subselect4.result @@ -1277,10 +1277,9 @@ EXPLAIN SELECT * FROM (t2 LEFT JOIN t1 ON t1.c1) LEFT JOIN t3 on t3.c1 WHERE 's' IN (SELECT c1 FROM t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found -1 PRIMARY t2 ALL NULL NULL NULL NULL 3 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; Start temporary; End temporary +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM (t2 LEFT JOIN t1 ON t1.c1) LEFT JOIN t3 on t3.c1 WHERE 's' IN (SELECT c1 FROM t2); c1 c1 c1 EXPLAIN diff --git a/mysql-test/main/subselect_no_exists_to_in.result b/mysql-test/main/subselect_no_exists_to_in.result index c6033e7a153..87283487ef1 100644 --- a/mysql-test/main/subselect_no_exists_to_in.result +++ b/mysql-test/main/subselect_no_exists_to_in.result @@ -7046,8 +7046,8 @@ SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY eq_ref distinct_key distinct_key 4 test.t2.c 1 +2 SUBQUERY ALL distinct_key NULL NULL NULL 1 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; diff --git a/mysql-test/main/subselect_no_opts.result b/mysql-test/main/subselect_no_opts.result index 7f51fa1a3fb..4e36ab903b3 100644 --- a/mysql-test/main/subselect_no_opts.result +++ b/mysql-test/main/subselect_no_opts.result @@ -7039,8 +7039,8 @@ SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY eq_ref distinct_key distinct_key 4 test.t2.c 1 +2 SUBQUERY ALL distinct_key NULL NULL NULL 1 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; diff --git a/mysql-test/main/subselect_no_scache.result b/mysql-test/main/subselect_no_scache.result index 623bef484fa..8635f5352f1 100644 --- a/mysql-test/main/subselect_no_scache.result +++ b/mysql-test/main/subselect_no_scache.result @@ -7051,8 +7051,8 @@ SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY eq_ref distinct_key distinct_key 4 test.t2.c 1 +2 SUBQUERY ALL distinct_key NULL NULL NULL 1 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result index a97459185ac..cca7f431d0e 100644 --- a/mysql-test/main/subselect_no_semijoin.result +++ b/mysql-test/main/subselect_no_semijoin.result @@ -928,8 +928,8 @@ a t1.a in (select t2.a from t2,t3 where t3.a=t2.a) explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 100.00 Using where -2 MATERIALIZED t2 ref a a 5 test.t3.a 2 100.00 Using index +2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 100.00 +2 MATERIALIZED t2 index a a 5 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<`test`.`t1`.`a`>((`test`.`t1`.`a`,`test`.`t1`.`a` in ( (/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t3`.`a` ), (`test`.`t1`.`a` in on distinct_key where `test`.`t1`.`a` = ``.`a`)))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; @@ -7039,8 +7039,8 @@ SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index -2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY eq_ref distinct_key distinct_key 4 test.t2.c 1 +2 SUBQUERY ALL distinct_key NULL NULL NULL 1 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; diff --git a/mysql-test/main/subselect_sj.result b/mysql-test/main/subselect_sj.result index ea2157edd95..55fb1bfe367 100644 --- a/mysql-test/main/subselect_sj.result +++ b/mysql-test/main/subselect_sj.result @@ -205,10 +205,10 @@ a b a b insert into t1 select (A.a + 10 * B.a),1 from t0 A, t0 B; explain extended select * from t1 where a in (select pk from t10 where pk<3); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 103 100.00 Using where -1 PRIMARY t10 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index +1 PRIMARY t10 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index +1 PRIMARY t1 ALL NULL NULL NULL NULL 103 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where `test`.`t10`.`pk` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t10`.`pk` and `test`.`t10`.`pk` < 3 drop table t0, t1, t2; drop table t10, t11, t12; @@ -2091,9 +2091,9 @@ explain SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE IFNULL(t2.f3,'foo') IN (SELECT * FROM t4); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 Start temporary 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where; End temporary +1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where +1 PRIMARY t4 ALL NULL NULL NULL NULL 2 Using where; Start temporary; End temporary SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3 ) WHERE IFNULL(t2.f3,'foo') IN (SELECT * FROM t4); f1 f2 f3 f3 2 0 0 0 diff --git a/mysql-test/main/subselect_sj_jcl6.result b/mysql-test/main/subselect_sj_jcl6.result index e4c37b752ec..d07002f978e 100644 --- a/mysql-test/main/subselect_sj_jcl6.result +++ b/mysql-test/main/subselect_sj_jcl6.result @@ -216,10 +216,10 @@ a b a b insert into t1 select (A.a + 10 * B.a),1 from t0 A, t0 B; explain extended select * from t1 where a in (select pk from t10 where pk<3); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 103 100.00 Using where -1 PRIMARY t10 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index +1 PRIMARY t10 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index +1 PRIMARY t1 ALL NULL NULL NULL NULL 103 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where `test`.`t10`.`pk` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t10`.`pk` and `test`.`t10`.`pk` < 3 drop table t0, t1, t2; drop table t10, t11, t12; @@ -2102,9 +2102,9 @@ explain SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE IFNULL(t2.f3,'foo') IN (SELECT * FROM t4); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 -1 PRIMARY t4 ALL NULL NULL NULL NULL 2 Start temporary; Using join buffer (flat, BNL join) -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where; End temporary; Using join buffer (incremental, BNL join) +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where; Using join buffer (incremental, BNL join) +1 PRIMARY t4 ALL NULL NULL NULL NULL 2 Using where; Start temporary; End temporary; Using join buffer (incremental, BNL join) SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3 ) WHERE IFNULL(t2.f3,'foo') IN (SELECT * FROM t4); f1 f2 f3 f3 2 0 0 0 diff --git a/sql/optimizer_costs.h b/sql/optimizer_costs.h index e8ca6697e1f..a518b0c368f 100644 --- a/sql/optimizer_costs.h +++ b/sql/optimizer_costs.h @@ -75,6 +75,13 @@ static inline double cache_hit_ratio(uint ratio) #define ROW_COPY_COST optimizer_row_copy_cost #define ROW_COPY_COST_THD(THD) ((THD)->variables.optimizer_row_copy_cost) +/* + Creating a record from the join cache is faster than getting a row from + the engine. JOIN_CACHE_ROW_COPY_COST_FACTOR is the factor used to + take this into account. This is multiplied with ROW_COPY_COST. +*/ +#define JOIN_CACHE_ROW_COPY_COST_FACTOR 0.75 + /* Cost of finding the next key during index scan and copying it to 'table->record' diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 486bc688cf3..e5f10e63249 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8786,7 +8786,8 @@ best_access_path(JOIN *join, row combinations, only a HASH_FANOUT (10%) rows in the cache. */ cmp_time= (rnd_records * record_count * HASH_FANOUT * - WHERE_COST_THD(thd)); + (ROW_COPY_COST_THD(thd) * JOIN_CACHE_ROW_COPY_COST_FACTOR + + WHERE_COST_THD(thd))); tmp= COST_ADD(tmp, cmp_time); best_cost= tmp; @@ -9018,7 +9019,8 @@ best_access_path(JOIN *join, row. */ cmp_time= (rnd_records * record_count * - (ROW_COPY_COST_THD(thd) * (idx - join->const_tables) + + (ROW_COPY_COST_THD(thd) * (idx - join->const_tables) * + JOIN_CACHE_ROW_COPY_COST_FACTOR + WHERE_COST_THD(thd))); tmp= COST_ADD(tmp, cmp_time); }