From f4863621300cbd40ef32be6771e32cf1f15598bd Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 30 Jun 2022 15:43:58 +0300 Subject: 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/select_safe.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/main/select_safe.test') diff --git a/mysql-test/main/select_safe.test b/mysql-test/main/select_safe.test index c76e337cd10..a32405278c2 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_compare_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; -- cgit v1.2.1