From d36c8c0f17a81f070289a5131a8887b07cdf7072 Mon Sep 17 00:00:00 2001 From: tianfengli Date: Wed, 13 Dec 2023 18:50:17 +0800 Subject: [PATCH] 'covering index' is not shown entirely in EXPLAIN FORMAT=TREE. --- mysql-test/r/bug29175494.result | 2 +- .../r/derived_condition_pushdown.result | 76 ++++----- .../r/derived_correlated_hypergraph.result | 2 +- mysql-test/r/explain_json_hypergraph.result | 16 +- mysql-test/r/explain_tree.result | 42 ++--- mysql-test/r/filesort.result | 4 +- mysql-test/r/group_by.result | 2 +- mysql-test/r/group_by_hypergraph.result | 6 +- mysql-test/r/hash_join.result | 32 ++-- mysql-test/r/hypergraph_bugs.result | 10 +- mysql-test/r/join.result | 2 +- mysql-test/r/join_cache_bka.result | 2 +- mysql-test/r/join_cache_bka_nobnl.result | 2 +- mysql-test/r/join_cache_bnl.result | 2 +- mysql-test/r/join_cache_nojb.result | 2 +- mysql-test/r/join_outer.result | 2 +- mysql-test/r/join_outer_bka.result | 2 +- mysql-test/r/join_outer_bka_nobnl.result | 2 +- mysql-test/r/olap.result | 2 +- mysql-test/r/range_all.result | 146 +++++++++--------- mysql-test/r/range_icp.result | 122 +++++++-------- mysql-test/r/range_icp_mrr.result | 122 +++++++-------- mysql-test/r/range_mrr.result | 122 +++++++-------- mysql-test/r/range_mrr_cost.result | 122 +++++++-------- mysql-test/r/range_none.result | 122 +++++++-------- mysql-test/r/row.result | 4 +- mysql-test/r/select_all.result | 2 +- mysql-test/r/select_all_bka.result | 2 +- mysql-test/r/select_all_bka_nobnl.result | 2 +- mysql-test/r/select_icp_mrr.result | 2 +- mysql-test/r/select_icp_mrr_bka.result | 2 +- mysql-test/r/select_icp_mrr_bka_nobnl.result | 2 +- mysql-test/r/select_none.result | 2 +- mysql-test/r/select_none_bka.result | 2 +- mysql-test/r/select_none_bka_nobnl.result | 2 +- mysql-test/r/subplan_tokens.result | 8 +- mysql-test/r/subquery_bugs.result | 22 +-- mysql-test/r/subquery_sj_all.result | 2 +- mysql-test/r/subquery_sj_all_bka.result | 2 +- mysql-test/r/subquery_sj_all_bka_nobnl.result | 2 +- mysql-test/r/subquery_sj_loosescan.result | 2 +- mysql-test/r/subquery_sj_loosescan_bka.result | 2 +- .../r/subquery_sj_loosescan_bka_nobnl.result | 2 +- mysql-test/r/subquery_sj_mat.result | 2 +- mysql-test/r/subquery_sj_mat_bka.result | 2 +- mysql-test/r/subquery_sj_mat_bka_nobnl.result | 2 +- mysql-test/r/subquery_sj_mat_nosj.result | 2 +- mysql-test/r/union.result | 2 +- ...window_functions_interesting_orders.result | 4 +- sql/join_optimizer/explain_access_path.cc | 37 +++-- 50 files changed, 545 insertions(+), 536 deletions(-) diff --git a/mysql-test/r/bug29175494.result b/mysql-test/r/bug29175494.result index d8e6d5d1b29..2673f99e90f 100644 --- a/mysql-test/r/bug29175494.result +++ b/mysql-test/r/bug29175494.result @@ -32,7 +32,7 @@ ON ( t2.col_int_key = alias2.col_int_key AND alias2.col_varchar_key IN ( SELECT WHERE alias1.col_varchar >= 'Z' ); EXPLAIN -> Filter: ((t1.col_varchar_key,t1.col_varchar_key),(select #2) is false) (cost=0.55 rows=3) - -> Index scan on t1 using k2 (cost=0.55 rows=3) + -> Covering index scan on t1 using k2 (cost=0.55 rows=3) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (cost=0.622 rows=0.222) -> Filter: ((outer_field_is_not_null, (alias1.col_varchar_key), true) and (outer_field_is_not_null, (alias1.col_varchar_key), true)) (cost=0.622 rows=0.222) diff --git a/mysql-test/r/derived_condition_pushdown.result b/mysql-test/r/derived_condition_pushdown.result index fe378798e4d..c752535fbc9 100644 --- a/mysql-test/r/derived_condition_pushdown.result +++ b/mysql-test/r/derived_condition_pushdown.result @@ -79,7 +79,7 @@ WHERE (dt.f1 = 6) or( t1.f2 = 50 and dt.f3 = 200); EXPLAIN -> Filter: ((dt.f1 = 6) or ((dt.f3 = 200) and (t1.f2 = 50))) (rows=27.4) -> Inner hash join (no condition) (rows=27.4) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) -> Hash -> Filter: ((dt.f1 = 6) or (dt.f3 = 200)) (rows=2.28) -> Table scan on dt (rows=12) @@ -279,14 +279,14 @@ EXPLAIN -> Inner hash join (no condition) (rows=144) -> Table scan on dt2 (rows=12) -> Materialize (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) -> Hash -> Table scan on dt1 (rows=12) -> Materialize (rows=12) -> Table scan on dt0 (rows=12) -> Materialize (rows=12) -> Filter: ((((t1.f1 + 10) + (t1.f2 + 10)) + ((t1.f1 + 10) - (t1.f2 + 10))) > 26) (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT * FROM (SELECT (i+j) AS g, f1 FROM @@ -339,7 +339,7 @@ EXPLAIN -> Table scan on dt1 (rows=12) -> Materialize (rows=12) -> Filter: (((t1.f1 + t1.f2) + 2) > 30) (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT m FROM (SELECT k+2 as l FROM (SELECT f1+f2 as j @@ -385,7 +385,7 @@ EXPLAIN -> Materialize (rows=7) -> Filter: (rollup_group_item(t1.f1,0) is null) (rows=7) -> Group aggregate with rollup: sum(t1.f2) (rows=7) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT f1 FROM (SELECT f1, SUM(f2) FROM t1 GROUP BY f1 WITH ROLLUP) as dt @@ -402,7 +402,7 @@ EXPLAIN -> Materialize (rows=7) -> Filter: (((rollup_group_item(t1.f1,0) + rollup_sum_switcher(sum(t1.f2))) > 50) or (rollup_group_item(t1.f1,0) is null)) (rows=7) -> Group aggregate with rollup: sum(t1.f2) (rows=7) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT * FROM (SELECT f1 as j, SUM(f2) as sum @@ -423,7 +423,7 @@ EXPLAIN -> Materialize (rows=7) -> Filter: ((rollup_sum_switcher(avg(t1.f2)) > 1) and (((rollup_group_item(t1.f1,0) + rollup_sum_switcher(sum(t1.f2))) > 50) or (rollup_group_item(t1.f1,0) is null))) (rows=7) -> Group aggregate with rollup: avg(t1.f2), sum(t1.f2) (rows=7) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT * FROM (SELECT f1 as j, SUM(f2) as sum @@ -456,7 +456,7 @@ EXPLAIN -> Materialize (rows=4) -> Limit: 4 row(s) (rows=4) -> Sort: t1.f2, limit input to 4 row(s) per chunk (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT f1 FROM (SELECT f1, f2 FROM t1 ORDER BY f2 LIMIT 4) as dt WHERE f1 > 0 ; @@ -467,7 +467,7 @@ EXPLAIN -> Table scan on dt (rows=4) -> Materialize (rows=4) -> Limit: 4 row(s) (rows=4) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT f1 FROM (SELECT f1, f2 FROM t1 LIMIT 4) as dt WHERE f1 > 0; f1 @@ -661,7 +661,7 @@ EXPLAIN -> Temporary table (rows=0) -> Window aggregate with buffering: sum(t1.f1) OVER (PARTITION BY t1.f2 ) -> Sort: t1.f2 (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT * FROM (SELECT f1, SUM(f1) OVER (PARTITION by f2), @@ -727,7 +727,7 @@ EXPLAIN -> Filter: (dt.a > 0.5) (rows=4) -> Table scan on dt (rows=12) -> Materialize (rows=12) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) EXPLAIN FORMAT=tree SELECT * FROM (SELECT f1, SUM(f2) FROM t1 GROUP BY f1) as dt WHERE f1 > 3*RAND() AND f1 < 10; @@ -765,10 +765,10 @@ EXPLAIN FORMAT=tree SELECT f1 FROM EXPLAIN -> Covering index lookup on dt using (f1=1) (rows=1.2) -> Materialize (rows=12) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) -> Select #3 (subquery in projection; run only once) -> Limit: 1 row(s) (rows=1) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) SELECT f1 FROM (SELECT (SELECT 1 FROM t1 LIMIT 1) as f1 FROM t1) as dt WHERE f1 = 1; @@ -798,7 +798,7 @@ EXPLAIN -> Table scan on dt (rows=6) -> Materialize (rows=6) -> Group aggregate: sum(t1.f2) (rows=6) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT * FROM (SELECT f1, SUM(f2) FROM t1 GROUP BY f1) as dt WHERE p() = 1; @@ -817,7 +817,7 @@ EXPLAIN -> Materialize (rows=6) -> Group aggregate: sum(t1.f2) (rows=6) -> Filter: ((p() = 1)) (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT * FROM (SELECT f1, SUM(f2) FROM t1 GROUP BY f1) as dt WHERE p() = 1; @@ -853,7 +853,7 @@ EXPLAIN -> Table scan on qn (rows=12) -> Materialize CTE qn (rows=12) -> Filter: ((3 * (10 * t1.f1)) > 1) (rows=12) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) SELECT * FROM ((WITH qn AS (SELECT 10*f1 as f1 FROM t1), qn2 AS (SELECT 3*f1 AS f2 FROM qn) @@ -883,7 +883,7 @@ EXPLAIN -> Filter: (qn.f1 < 10) (rows=4) -> Table scan on qn (rows=12) -> Materialize CTE qn if needed (rows=12) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) SELECT * FROM ((WITH qn AS (SELECT 10*f1 as f1 FROM t1), qn2 AS (SELECT 3*f1 AS f2 FROM qn) @@ -928,7 +928,7 @@ EXPLAIN -> Hash -> Table scan on dt (rows=12) -> Materialize (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT * FROM t1 LEFT JOIN (SELECT f1, f2 FROM t1) as dt USING (f2) WHERE dt.f1 is null; @@ -1001,9 +1001,9 @@ EXPLAIN -> Materialize (rows=48) -> Filter: (t2.f1 > 3) (rows=48) -> Left hash join (no condition) (rows=48) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) -> Hash - -> Index scan on t2 using f1_2 (rows=12) + -> Covering index scan on t2 using f1_2 (rows=12) -> Hash -> Table scan on t1 (rows=12) @@ -1450,7 +1450,7 @@ EXPLAIN -> Filter: (t1.f1 > 10) (rows=1) -> Covering index range scan on t1 using f1 over (10 < f1) (rows=1) -> Filter: (t2.f2 > 10) (rows=4) - -> Index scan on t2 using f1_2 (rows=12) + -> Covering index scan on t2 using f1_2 (rows=12) SELECT i FROM (SELECT f1 FROM t1 @@ -1497,10 +1497,10 @@ EXPLAIN -> Union all materialize (rows=13) -> Filter: ((rollup_sum_switcher(avg(t1.f2)) > 1) and (((rollup_group_item(t1.f1,0) + rollup_sum_switcher(sum(t1.f2))) > 50) or (rollup_group_item(t1.f1,0) is null))) (rows=7) -> Group aggregate with rollup: avg(t1.f2), sum(t1.f2) (rows=7) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) -> Filter: (((t1.f1 + sum(t1.f2)) > 50) or (t1.f1 is null)) (rows=6) -> Group aggregate: sum(t1.f2) (rows=6) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT * FROM (SELECT f1 as j, SUM(f2) as sum @@ -1669,8 +1669,8 @@ EXPLAIN -> Filter: (dt.a > 0.5) (rows=8) -> Table scan on dt (rows=24) -> Union all materialize (rows=24) - -> Index scan on t1 using f1 (rows=12) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) EXPLAIN FORMAT=tree SELECT * FROM (SELECT f1, SUM(f2) FROM t1 GROUP BY f1 @@ -1710,11 +1710,11 @@ WHERE f1 = 1; EXPLAIN -> Covering index lookup on dt using (f1=1) (rows=2.4) -> Union all materialize (rows=24) - -> Index scan on t1 using f1 (rows=12) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) -> Select #4 (subquery in projection; run only once) -> Limit: 1 row(s) (rows=1) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) SELECT f1 FROM (SELECT f1 FROM t1 @@ -1745,9 +1745,9 @@ EXPLAIN -> Covering index lookup on dt using (f1=1) (rows=2.4) -> Union all materialize (rows=24) -> Limit table size: 1 row(s) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) -> Limit table size: 1 row(s) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) EXPLAIN FORMAT=tree SELECT f1 FROM (SELECT f1 FROM t1 @@ -1757,9 +1757,9 @@ WHERE f1 = 1; EXPLAIN -> Covering index lookup on dt using (f1=1) (rows=1.3) -> Union all materialize (rows=13) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) -> Limit: 1 row(s) (rows=1) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) CREATE FUNCTION p() RETURNS INTEGER BEGIN @@ -1777,8 +1777,8 @@ EXPLAIN -> Table scan on dt (rows=18) -> Union materialize with deduplication (rows=18) -> Group aggregate: sum(t1.f2) (rows=6) - -> Index scan on t1 using f1_2 (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT * FROM (SELECT f1, SUM(f2) FROM t1 GROUP BY f1 @@ -1803,9 +1803,9 @@ EXPLAIN -> Union materialize with deduplication (rows=18) -> Group aggregate: sum(t1.f2) (rows=6) -> Filter: ((p() = 1)) (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) -> Filter: ((p() = 1)) (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) SELECT * FROM (SELECT f1, SUM(f2) FROM t1 GROUP BY f1 @@ -1861,7 +1861,7 @@ EXPLAIN -> Filter: (qn.f1 > 1) (rows=8) -> Table scan on qn (rows=24) -> Materialize recursive CTE qn with deduplication (rows=24) - -> Index scan on t1 using f1 (rows=12) + -> Covering index scan on t1 using f1 (rows=12) -> Repeat until convergence -> Scan new records on qn (rows=12) @@ -1948,7 +1948,7 @@ EXPLAIN -> Table scan on dt2 (rows=13) -> Union materialize with deduplication (rows=13) -> Filter: ((t1.f1 + t1.f2) > 30) (rows=12) - -> Index scan on t1 using f1_2 (rows=12) + -> Covering index scan on t1 using f1_2 (rows=12) -> Filter: (t1.f1 > 30) (rows=1) -> Covering index range scan on t1 using f1_2 over (30 < f1) (rows=1) diff --git a/mysql-test/r/derived_correlated_hypergraph.result b/mysql-test/r/derived_correlated_hypergraph.result index 28eb75b36ae..2023f77c808 100644 --- a/mysql-test/r/derived_correlated_hypergraph.result +++ b/mysql-test/r/derived_correlated_hypergraph.result @@ -19,7 +19,7 @@ EXPLAIN -> Nested loop inner join (cost=0.25..0.25 rows=1) -> Stream results (cost=0..0 rows=1) -> Rows fetched before execution (cost=0..0 rows=1) - -> Single-row index lookup on t2 using PRIMARY (pk=dt.x) (cost=0.25..0.25 rows=1) + -> Single-row covering index lookup on t2 using PRIMARY (pk=dt.x) (cost=0.25..0.25 rows=1) Warnings: Note 1276 Field or reference 'test.t1.x' of SELECT #2 was resolved in SELECT #1 diff --git a/mysql-test/r/explain_json_hypergraph.result b/mysql-test/r/explain_json_hypergraph.result index e7692940772..e282d4e9db6 100644 --- a/mysql-test/r/explain_json_hypergraph.result +++ b/mysql-test/r/explain_json_hypergraph.result @@ -173,8 +173,8 @@ test.t2 analyze status OK EXPLAIN format=TREE SELECT * FROM t1 WHERE t1.i IN (SELECT t2.i FROM t2); EXPLAIN -> Nested loop semijoin (cost=0.313..1.25 rows=4) - -> Index scan on t1 using PRIMARY (cost=0.0626..0.25 rows=4) - -> Index lookup on t2 using i1 (i=t1.i) (cost=0.25..0.25 rows=1) + -> Covering index scan on t1 using PRIMARY (cost=0.0626..0.25 rows=4) + -> Covering index lookup on t2 using i1 (i=t1.i) (cost=0.25..0.25 rows=1) EXPLAIN format=JSON SELECT * FROM t1 WHERE t1.i IN (SELECT t2.i FROM t2); EXPLAIN @@ -183,7 +183,7 @@ EXPLAIN "inputs": [ { "covering": false, - "operation": "Index scan on t1 using PRIMARY", + "operation": "Covering index scan on t1 using PRIMARY", "index_name": "PRIMARY", "table_name": "t1", "access_type": "index", @@ -194,7 +194,7 @@ EXPLAIN }, { "covering": false, - "operation": "Index lookup on t2 using i1 (i=t1.i)", + "operation": "Covering index lookup on t2 using i1 (i=t1.i)", "index_name": "i1", "table_name": "t2", "access_type": "index", @@ -462,7 +462,7 @@ EXPLAIN -> Window aggregate with buffering: sum(t1.f2) OVER () (cost=0.343..2.06 rows=6) -> Stream results (cost=0.243..1.46 rows=6) -> Group (no aggregates) (cost=0.243..1.46 rows=6) - -> Index scan on t1 using f1_2 (cost=0.0213..0.255 rows=12) + -> Covering index scan on t1 using f1_2 (cost=0.0213..0.255 rows=12) EXPLAIN FORMAT=JSON SELECT * FROM (SELECT f1, SUM(f2) OVER() FROM t1 GROUP BY f1) as dt @@ -483,7 +483,7 @@ EXPLAIN "inputs": [ { "covering": false, - "operation": "Index scan on t1 using f1_2", + "operation": "Covering index scan on t1 using f1_2", "index_name": "f1_2", "table_name": "t1", "access_type": "index", @@ -629,7 +629,7 @@ EXPLAIN -> Group aggregate: group_concat(t2.b separator ',') (cost=0.751..1.3 rows=1.73) (actual rows=3 loops=1) -> Nested loop left join (cost=0.333..1 rows=3) (actual rows=4 loops=1) -> Index scan on t1 using PRIMARY (cost=0.0834..0.25 rows=3) (actual rows=3 loops=1) - -> Index lookup on t2 using PRIMARY (a=t1.a) (cost=0.25..0.25 rows=1) (actual rows=1 loops=3) + -> Covering index lookup on t2 using PRIMARY (a=t1.a) (cost=0.25..0.25 rows=1) (actual rows=1 loops=3) EXPLAIN FORMAT=JSON SELECT t1.a, GROUP_CONCAT(t2.b) AS b FROM t1 LEFT JOIN t2 ON t1.a=t2.a GROUP BY t1.a ORDER BY t1.b; EXPLAIN @@ -657,7 +657,7 @@ EXPLAIN }, { "covering": false, - "operation": "Index lookup on t2 using PRIMARY (a=t1.a)", + "operation": "Covering index lookup on t2 using PRIMARY (a=t1.a)", "index_name": "PRIMARY", "table_name": "t2", "access_type": "index", diff --git a/mysql-test/r/explain_tree.result b/mysql-test/r/explain_tree.result index 16c3225c6cd..bdd37452b84 100644 --- a/mysql-test/r/explain_tree.result +++ b/mysql-test/r/explain_tree.result @@ -67,7 +67,7 @@ Table Op Msg_type Msg_text test.t1 analyze status OK EXPLAIN FORMAT=tree SELECT * FROM t1 ORDER BY f1 DESC; EXPLAIN --> Index scan on t1 using PRIMARY (reverse) (cost=0.55 rows=3) +-> Covering index scan on t1 using PRIMARY (reverse) (cost=0.55 rows=3) DROP TABLE t1; CREATE TABLE t1 ( f1 INT, INDEX ( f1 ) ); @@ -80,22 +80,22 @@ test.t1 analyze status OK EXPLAIN FORMAT=tree SELECT SUM(f1) FROM t1; EXPLAIN -> Aggregate: sum(t1.f1) (cost=0.85 rows=1) - -> Index scan on t1 using f1 (cost=0.55 rows=3) + -> Covering index scan on t1 using f1 (cost=0.55 rows=3) EXPLAIN FORMAT=tree SELECT f1 FROM t1 GROUP BY f1; EXPLAIN -> Group (no aggregates) (cost=0.85 rows=1.73) - -> Index scan on t1 using f1 (cost=0.55 rows=3) + -> Covering index scan on t1 using f1 (cost=0.55 rows=3) EXPLAIN FORMAT=tree SELECT f1,COUNT(*) FROM t1 GROUP BY f1; EXPLAIN -> Group aggregate: count(0) (cost=0.85 rows=1.73) - -> Index scan on t1 using f1 (cost=0.55 rows=3) + -> Covering index scan on t1 using f1 (cost=0.55 rows=3) EXPLAIN FORMAT=tree SELECT f1,COUNT(*) FROM t1 GROUP BY f1 WITH ROLLUP; EXPLAIN -> Group aggregate with rollup: count(0) (cost=0.85 rows=2.73) - -> Index scan on t1 using f1 (cost=0.55 rows=3) + -> Covering index scan on t1 using f1 (cost=0.55 rows=3) DROP TABLE t1; CREATE TABLE t1 ( f1 INT PRIMARY KEY ); @@ -123,7 +123,7 @@ test.t2 analyze status OK EXPLAIN FORMAT=tree SELECT * FROM t1 LEFT JOIN t2 ON t1.f1 = t2.f1 + 2 AND t2.f1 = 3; EXPLAIN -> Nested loop left join (cost=1.1 rows=3) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) -> Filter: (t1.f1 = ((3 + 2))) (cost=0.117..0.117 rows=1) -> Constant row from t2 (cost=0.117..0.117 rows=1) @@ -180,7 +180,7 @@ EXPLAIN FORMAT=tree SELECT * FROM t1 LEFT JOIN t2 USING (f1) WHERE t2.f1 IS NULL EXPLAIN -> Filter: (t2.f1 is null) (cost=2.8 rows=3) -> Nested loop antijoin (cost=2.8 rows=3) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) -> Filter: (t2.f1 = t1.f1) (cost=0.483 rows=1) -> Table scan on t2 (cost=0.483 rows=3) @@ -282,7 +282,7 @@ EXPLAIN -> Table scan on (cost=1.91..3.18 rows=2) -> Temporary table (cost=0.65..0.65 rows=2) -> Limit table size: 1 row(s) - -> Index scan on t1 using PRIMARY (cost=0.45 rows=2) + -> Covering index scan on t1 using PRIMARY (cost=0.45 rows=2) DROP TABLE t1; CREATE TABLE t1 (a INTEGER, b INTEGER); @@ -313,7 +313,7 @@ test.t1 analyze status OK EXPLAIN FORMAT=tree SELECT * FROM t1 WHERE f1 = ( SELECT MIN(f1) FROM t1 AS i WHERE i.f1 > t1.f1 ); EXPLAIN -> Filter: (t1.f1 = (select #2)) (cost=0.55 rows=3) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) -> Select #2 (subquery in condition; dependent) -> Aggregate: min(i.f1) (cost=0.45 rows=1) -> Filter: (i.f1 > t1.f1) (cost=0.35 rows=1) @@ -324,7 +324,7 @@ Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1 EXPLAIN FORMAT=tree SELECT * FROM t1 WHERE f1 > ( SELECT f1 FROM t1 LIMIT 1 ); EXPLAIN -> Filter: (t1.f1 > (select #2)) (cost=0.55 rows=2) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) -> Select #2 (subquery in condition; run only once) -> Limit: 1 row(s) (cost=0.55 rows=1) -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) @@ -340,9 +340,9 @@ test.t1 analyze status OK EXPLAIN FORMAT=tree SELECT * FROM t1 WHERE f1 = ( SELECT ( SELECT MIN(f1) FROM t1 AS ii WHERE ii.f1 > t1.f1 ) > i.f1 FROM t1 AS i ) ; EXPLAIN -> Filter: (t1.f1 = (select #2)) (cost=0.55 rows=3) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) -> Select #2 (subquery in condition; dependent) - -> Index scan on i using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on i using PRIMARY (cost=0.55 rows=3) -> Select #3 (subquery in projection; dependent) -> Aggregate: min(ii.f1) (cost=0.45 rows=1) -> Filter: (ii.f1 > t1.f1) (cost=0.35 rows=1) @@ -360,7 +360,7 @@ Table Op Msg_type Msg_text test.t1 analyze status OK EXPLAIN FORMAT=tree SELECT ( SELECT ( SELECT ( SELECT MIN(f1) FROM t1 i WHERE i.f1 > t1.f1 ) + 1 ) + 1 ) FROM t1; EXPLAIN --> Index scan on t1 using PRIMARY (cost=0.55 rows=3) +-> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) -> Select #4 (subquery in projection; dependent) -> Aggregate: min(i.f1) (cost=0.45 rows=1) -> Filter: (i.f1 > t1.f1) (cost=0.35 rows=1) @@ -382,7 +382,7 @@ EXPLAIN FORMAT=tree SELECT ( SELECT f1 FROM t1 AS inner_t1 WHERE inner_t1.f1 > t EXPLAIN -> Sort: tmp1 -> Stream results (cost=0.55 rows=3) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) -> Select #2 (subquery in projection; dependent) -> Limit: 1 row(s) (cost=0.35 rows=1) -> Filter: (inner_t1.f1 > t1.f1) (cost=0.35 rows=1) @@ -674,7 +674,7 @@ EXPLAIN -> Nested loop inner join (cost=2.05 rows=4) -> Remove duplicates from input sorted on i1 (cost=0.651 rows=4) -> Filter: (t2.i is not null) (cost=0.651 rows=4) - -> Index scan on t2 using i1 (cost=0.651 rows=4) + -> Covering index scan on t2 using i1 (cost=0.651 rows=4) -> Single-row covering index lookup on t1 using PRIMARY (i=t2.i) (cost=1.1 rows=1) DROP TABLE t1; @@ -747,20 +747,20 @@ test.t1 analyze status OK EXPLAIN FORMAT=tree SELECT * FROM t1, ( SELECT f1 FROM t1 UNION SELECT f1 + 10 FROM t1 ) d1; EXPLAIN -> Nested loop inner join (cost=10.1 rows=18) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) -> Table scan on d1 (cost=2.13..4.28 rows=6) -> Union materialize with deduplication (cost=1.7..1.7 rows=6) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) EXPLAIN FORMAT=tree SELECT * FROM t1, ( SELECT f1 FROM t1 UNION ALL SELECT f1 + 10 FROM t1 ) d1; EXPLAIN -> Nested loop inner join (cost=10.1 rows=18) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) -> Table scan on d1 (cost=2.13..4.28 rows=6) -> Union all materialize (cost=1.7..1.7 rows=6) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) DROP TABLE t1; # diff --git a/mysql-test/r/filesort.result b/mysql-test/r/filesort.result index 67e667a123e..dd913fbe380 100644 --- a/mysql-test/r/filesort.result +++ b/mysql-test/r/filesort.result @@ -135,8 +135,8 @@ EXPLAIN -> Nested loop inner join -> Constant row from SUBQUERY1_t2 -> Table scan on table2 - -> Index scan on SUBQUERY1_t1 using PRIMARY - -> Index scan on t1 using PRIMARY + -> Covering index scan on SUBQUERY1_t1 using PRIMARY + -> Covering index scan on t1 using PRIMARY DROP TABLE t1, t2; # diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 736fa514fe4..2ef51d6fde8 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -4513,7 +4513,7 @@ EXPLAIN -> Group aggregate: count(0) (rows=250) -> Nested loop left join (rows=8000) -> Nested loop left join (rows=8000) - -> Index scan on t1 using b (rows=8000) + -> Covering index scan on t1 using b (rows=8000) -> Single-row covering index lookup on t2 using PRIMARY (b=t1.b) (rows=1) -> Single-row covering index lookup on t3 using PRIMARY (b=t1.b) (rows=1) diff --git a/mysql-test/r/group_by_hypergraph.result b/mysql-test/r/group_by_hypergraph.result index 54f09d7e1c3..ebe094c035e 100644 --- a/mysql-test/r/group_by_hypergraph.result +++ b/mysql-test/r/group_by_hypergraph.result @@ -297,19 +297,19 @@ EXPLAIN ANALYZE SELECT 1 FROM t1 GROUP BY c,a,d WITH ROLLUP; EXPLAIN -> Group (no aggregates) (rows=423) (actual rows=446 loops=1) -> Sort: t1.c, t1.a, t1.d (rows=1000) (actual rows=1000 loops=1) - -> Index scan on t1 using ix1 (rows=1000) (actual rows=1000 loops=1) + -> Covering index scan on t1 using ix1 (rows=1000) (actual rows=1000 loops=1) EXPLAIN ANALYZE SELECT 1 FROM t1 GROUP BY c,a; EXPLAIN -> Group (no aggregates) (rows=32.3) (actual rows=55 loops=1) -> Sort: t1.c, t1.a (rows=1000) (actual rows=1000 loops=1) - -> Index scan on t1 using ix1 (rows=1000) (actual rows=1000 loops=1) + -> Covering index scan on t1 using ix1 (rows=1000) (actual rows=1000 loops=1) EXPLAIN ANALYZE SELECT 1 FROM t1 GROUP BY c,b; EXPLAIN -> Group (no aggregates) (rows=93) (actual rows=100 loops=1) -> Sort: t1.c, t1.b (rows=1000) (actual rows=1000 loops=1) - -> Index scan on t1 using ix1 (rows=1000) (actual rows=1000 loops=1) + -> Covering index scan on t1 using ix1 (rows=1000) (actual rows=1000 loops=1) EXPLAIN ANALYZE SELECT 1 FROM t1 GROUP BY e,f; EXPLAIN diff --git a/mysql-test/r/hash_join.result b/mysql-test/r/hash_join.result index c3651efd30e..0c9c6dd830e 100644 --- a/mysql-test/r/hash_join.result +++ b/mysql-test/r/hash_join.result @@ -955,7 +955,7 @@ EXPLAIN -> Table scan on (cost=7.46..10.2 rows=27) -> Temporary table with deduplication (cost=7.35..7.35 rows=27) -> Inner hash join (no condition) (cost=4.65 rows=27) - -> Index scan on alias1 using idx_CC_col_varchar_key (cost=0.183 rows=3) + -> Covering index scan on alias1 using idx_CC_col_varchar_key (cost=0.183 rows=3) -> Hash -> Nested loop antijoin (cost=1.7 rows=9) -> Table scan on t1 (cost=0.55 rows=3) @@ -1045,7 +1045,7 @@ EXPLAIN -> Inner hash join (no condition) (cost=1 rows=2) -> Table scan on table1 (cost=0.45 rows=4) -> Hash - -> Index scan on table2 using varchar_key (cost=0.35 rows=1) + -> Covering index scan on table2 using varchar_key (cost=0.35 rows=1) -> Nested loop inner join (cost=2.85 rows=4) -> Filter: (alias3.pk >= table1.pk) (cost=0.45 rows=4) -> Index range scan on alias3 (re-planned for each iteration) (cost=0.45 rows=4) @@ -1305,7 +1305,7 @@ EXPLAIN -> Table scan on t4 (cost=0.117 rows=1) -> Hash -> Filter: (t2.f2 is not null) (cost=0.55 rows=3) - -> Index scan on t2 using f2 (cost=0.55 rows=3) + -> Covering index scan on t2 using f2 (cost=0.55 rows=3) -> Covering index lookup on ta3 using f2 (f2=t2.f2) (cost=0.3 rows=1.5) -> Single-row covering index lookup on ta4 using PRIMARY (f1=t4.f1) (cost=0.0778 rows=1) @@ -1703,11 +1703,11 @@ EXPLAIN -> Temporary table with deduplication (cost=208..208 rows=936) -> Remove duplicate alias1 rows using temporary table (weedout) (cost=114 rows=936) -> Inner hash join (no condition) (cost=114 rows=936) - -> Index scan on sq2_alias2 using col_date_key (cost=1.93 rows=20) + -> Covering index scan on sq2_alias2 using col_date_key (cost=1.93 rows=20) -> Hash -> Nested loop inner join (cost=20.4 rows=46.8) -> Filter: (sq2_alias1.col_varchar_key is not null) (cost=2.25 rows=20) - -> Index scan on sq2_alias1 using col_varchar_key (cost=2.25 rows=20) + -> Covering index scan on sq2_alias1 using col_varchar_key (cost=2.25 rows=20) -> Filter: (sq2_alias1.col_varchar_key <> alias1.col_varchar) (cost=7.49..0.662 rows=2.34) -> Index lookup on alias1 using (col_varchar_key=sq2_alias1.col_varchar_key) (cost=12.8..13.2 rows=2.6) -> Materialize (cost=12.6..12.6 rows=26.7) @@ -1831,7 +1831,7 @@ EXPLAIN -> Temporary table with deduplication (cost=0.65..0.65 rows=2) -> Table scan on subquery2_t1 (cost=0.45 rows=2) -> Filter: (subquery1_t1.col_varchar = lower(subquery3_t1.pk)) (cost=0.175 rows=1) - -> Index scan on subquery3_t1 using PRIMARY (cost=0.175 rows=1) + -> Covering index scan on subquery3_t1 using PRIMARY (cost=0.175 rows=1) SELECT table1.col_varchar @@ -2138,7 +2138,7 @@ EXPLAIN -> Nested loop antijoin (cost=10 rows=34) -> Inner hash join (no condition) (cost=6.38 rows=34) -> Filter: (t2.col1 < 49) (cost=0.975 rows=17) - -> Index scan on t2 using idx (cost=0.975 rows=17) + -> Covering index scan on t2 using idx (cost=0.975 rows=17) -> Hash -> Table scan on const_table (cost=1.46..2.73 rows=2) -> Materialize (cost=0.2..0.2 rows=2) @@ -2146,7 +2146,7 @@ EXPLAIN -> Limit: 1 row(s) (cost=8.61 rows=1) -> Nested loop inner join (cost=8.61 rows=1) -> Filter: (t1.col1 <> t2.col1) (cost=0.0103 rows=1) - -> Index scan on t1 using idx (cost=0.0103 rows=1) + -> Covering index scan on t1 using idx (cost=0.0103 rows=1) -> Covering index lookup on t1_2 using idx (col1=t1.col1) (cost=0.253 rows=1) Warnings: @@ -3060,7 +3060,7 @@ EXPLAIN FORMAT=tree SELECT * FROM t1 LEFT JOIN t2 USING (f1) WHERE t2.f1 IS NULL EXPLAIN -> Filter: (t2.f1 is null) (cost=1.97 rows=3) -> Hash antijoin (t2.f1 = t1.f1) (cost=1.97 rows=3) - -> Index scan on t1 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t1 using PRIMARY (cost=0.55 rows=3) -> Hash -> Table scan on t2 (cost=0.217 rows=4) @@ -3574,13 +3574,13 @@ EXPLAIN FORMAT=tree SELECT * FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON NOT EXI SELECT * FROM t1 WHERE alias1.pk NOT IN ( 20 ) ); EXPLAIN -> Nested loop left join (cost=42.5 rows=400) - -> Index scan on alias1 using PRIMARY (cost=2.25 rows=20) + -> Covering index scan on alias1 using PRIMARY (cost=2.25 rows=20) -> Hash antijoin (no condition) (cost=2.37 rows=20) - -> Index scan on alias2 using PRIMARY (cost=0.113 rows=20) + -> Covering index scan on alias2 using PRIMARY (cost=0.113 rows=20) -> Hash -> Limit: 1 row(s) (cost=0.113 rows=1) -> Filter: (alias1.pk <> 20) (cost=0.113 rows=20) - -> Index scan on t1 using PRIMARY (cost=0.113 rows=20) + -> Covering index scan on t1 using PRIMARY (cost=0.113 rows=20) Warnings: Note 1276 Field or reference 'test.alias1.pk' of SELECT #2 was resolved in SELECT #1 @@ -3725,7 +3725,7 @@ EXPLAIN -> Hash antijoin (no condition), extra conditions: ((inner_t3.pk >= 1) or (table1.f1 = 'G')) (cost=2.01 rows=16) -> Table scan on inner_t3 (cost=0.163 rows=4) -> Hash - -> Index scan on t1 using i1 (cost=0.163 rows=4) + -> Covering index scan on t1 using i1 (cost=0.163 rows=4) -> Filter: (inner_t2.f1 = inner_t1.f1) (cost=0.252 rows=1) -> Multi-range index lookup on inner_t2 using i1 (pk=inner_t1.pk) (cost=0.252 rows=1) @@ -3843,7 +3843,7 @@ FROM t2 AS c1_1 INNER JOIN t2 AS c1_2 STRAIGHT_JOIN t3 ON t3.i = c1_2.i EXPLAIN -> Filter: ((t1.str_col,t1.str_col),(select #2) is false) (cost=0.875 rows=4) -> Left hash join (t1.str_col = t2.str_col) (cost=0.875 rows=4) - -> Index scan on t2 using idx (cost=0.45 rows=2) + -> Covering index scan on t2 using idx (cost=0.45 rows=2) -> Hash -> Table scan on t1 (cost=0.225 rows=2) -> Select #2 (subquery in condition; dependent) @@ -3854,9 +3854,9 @@ EXPLAIN -> Table scan on t3 (cost=0.0875 rows=1) -> Hash -> Inner hash join (no condition) (cost=1.1 rows=4) - -> Index scan on c1_2 using idx (cost=0.225 rows=2) + -> Covering index scan on c1_2 using idx (cost=0.225 rows=2) -> Hash - -> Index scan on c1_1 using idx (cost=0.45 rows=2) + -> Covering index scan on c1_1 using idx (cost=0.45 rows=2) SELECT 1 FROM t1 RIGHT JOIN t2 ON t2.str_col = t1.str_col WHERE (t1.str_col, t1.str_col) NOT IN ( diff --git a/mysql-test/r/hypergraph_bugs.result b/mysql-test/r/hypergraph_bugs.result index 90bd9716652..e99ead6c659 100644 --- a/mysql-test/r/hypergraph_bugs.result +++ b/mysql-test/r/hypergraph_bugs.result @@ -247,31 +247,31 @@ EXPLAIN ANALYZE SELECT 1 FROM t1,t2 WHERE ai=b; EXPLAIN -> Nested loop inner join (rows=4000) (actual rows=4000 loops=1) -> Table scan on t2 (rows=1000) (actual rows=1000 loops=1) - -> Index lookup on t1 using ix1 (ai=t2.b) (rows=4) (actual rows=4 loops=1000) + -> Covering index lookup on t1 using ix1 (ai=t2.b) (rows=4) (actual rows=4 loops=1000) EXPLAIN ANALYZE SELECT 1 FROM t1 x1, t1 x2 WHERE x1.ai=x2.ai; EXPLAIN -> Nested loop inner join (rows=400) (actual rows=400 loops=1) -> Table scan on x2 (rows=100) (actual rows=100 loops=1) - -> Index lookup on x1 using ix1 (ai=x2.ai) (rows=4) (actual rows=4 loops=100) + -> Covering index lookup on x1 using ix1 (ai=x2.ai) (rows=4) (actual rows=4 loops=100) EXPLAIN ANALYZE SELECT 1 FROM t1,t2 WHERE ai=bi; EXPLAIN -> Nested loop inner join (rows=4000) (actual rows=4000 loops=1) -> Table scan on t1 (rows=100) (actual rows=100 loops=1) - -> Index lookup on t2 using ix2 (bi=t1.ai) (rows=40) (actual rows=40 loops=100) + -> Covering index lookup on t2 using ix2 (bi=t1.ai) (rows=40) (actual rows=40 loops=100) EXPLAIN ANALYZE SELECT 1 FROM t1,t2 WHERE a=bi; EXPLAIN -> Nested loop inner join (rows=4000) (actual rows=4000 loops=1) -> Table scan on t1 (rows=100) (actual rows=100 loops=1) - -> Index lookup on t2 using ix2 (bi=t1.a) (rows=40) (actual rows=40 loops=100) + -> Covering index lookup on t2 using ix2 (bi=t1.a) (rows=40) (actual rows=40 loops=100) EXPLAIN ANALYZE SELECT 1 FROM t2 x1, t2 x2 WHERE x1.bi=x2.bi; EXPLAIN -> Nested loop inner join (rows=40000) (actual rows=40000 loops=1) -> Table scan on x2 (rows=1000) (actual rows=1000 loops=1) - -> Index lookup on x1 using ix2 (bi=x2.bi) (rows=40) (actual rows=40 loops=1000) + -> Covering index lookup on x1 using ix2 (bi=x2.bi) (rows=40) (actual rows=40 loops=1000) EXPLAIN ANALYZE SELECT 1 FROM t1,t2 WHERE ah=b; EXPLAIN diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index c5f7418ae51..ec8d577db3c 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1793,7 +1793,7 @@ Table Op Msg_type Msg_text test.t analyze status OK EXPLAIN FORMAT=tree SELECT t1.i AS a, (SELECT t2.i FROM t t2 WHERE t1.j = t2.j ORDER BY j DESC, i DESC LIMIT 1) AS b FROM t t1; EXPLAIN --> Index scan on t1 using j (cost=412 rows=4096) +-> Covering index scan on t1 using j (cost=412 rows=4096) -> Select #2 (subquery in projection; dependent) -> Limit: 1 row(s) (cost=411 rows=1) -> Covering index lookup on t2 using j (j=t1.j) (reverse) (cost=411 rows=4096) diff --git a/mysql-test/r/join_cache_bka.result b/mysql-test/r/join_cache_bka.result index ce441003aa4..95bfef3b05d 100644 --- a/mysql-test/r/join_cache_bka.result +++ b/mysql-test/r/join_cache_bka.result @@ -2676,7 +2676,7 @@ WHERE t3.c1 = SOME (SELECT t1.c2_key FROM t2 JOIN t1 ON t2.pk < t1.c1) XOR TRUE; EXPLAIN -> Filter: ((t3.c1,(select #2)) xor true) (cost=0.45 rows=2) - -> Index scan on t3 using k1 (cost=0.45 rows=2) + -> Covering index scan on t3 using k1 (cost=0.45 rows=2) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (cost=0.716 rows=1) -> Nested loop inner join (cost=0.716 rows=1) diff --git a/mysql-test/r/join_cache_bka_nobnl.result b/mysql-test/r/join_cache_bka_nobnl.result index 5d5790695e6..f88b171bd6c 100644 --- a/mysql-test/r/join_cache_bka_nobnl.result +++ b/mysql-test/r/join_cache_bka_nobnl.result @@ -2676,7 +2676,7 @@ WHERE t3.c1 = SOME (SELECT t1.c2_key FROM t2 JOIN t1 ON t2.pk < t1.c1) XOR TRUE; EXPLAIN -> Filter: ((t3.c1,(select #2)) xor true) (cost=0.45 rows=2) - -> Index scan on t3 using k1 (cost=0.45 rows=2) + -> Covering index scan on t3 using k1 (cost=0.45 rows=2) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (cost=0.7 rows=1) -> Nested loop inner join (cost=0.7 rows=1) diff --git a/mysql-test/r/join_cache_bnl.result b/mysql-test/r/join_cache_bnl.result index 69998c6361c..09a23064d6b 100644 --- a/mysql-test/r/join_cache_bnl.result +++ b/mysql-test/r/join_cache_bnl.result @@ -2677,7 +2677,7 @@ WHERE t3.c1 = SOME (SELECT t1.c2_key FROM t2 JOIN t1 ON t2.pk < t1.c1) XOR TRUE; EXPLAIN -> Filter: ((t3.c1,(select #2)) xor true) (cost=0.45 rows=2) - -> Index scan on t3 using k1 (cost=0.45 rows=2) + -> Covering index scan on t3 using k1 (cost=0.45 rows=2) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (cost=0.716 rows=1) -> Nested loop inner join (cost=0.716 rows=1) diff --git a/mysql-test/r/join_cache_nojb.result b/mysql-test/r/join_cache_nojb.result index 511a96e2c31..5685361887a 100644 --- a/mysql-test/r/join_cache_nojb.result +++ b/mysql-test/r/join_cache_nojb.result @@ -2677,7 +2677,7 @@ WHERE t3.c1 = SOME (SELECT t1.c2_key FROM t2 JOIN t1 ON t2.pk < t1.c1) XOR TRUE; EXPLAIN -> Filter: ((t3.c1,(select #2)) xor true) (cost=0.45 rows=2) - -> Index scan on t3 using k1 (cost=0.45 rows=2) + -> Covering index scan on t3 using k1 (cost=0.45 rows=2) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (cost=0.7 rows=1) -> Nested loop inner join (cost=0.7 rows=1) diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index e6ddcc8dad6..154058e2601 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -405,7 +405,7 @@ Thimble Smith Happy 3 3 explain format=tree select t1.name, t2.name, t2.id, t2.owner, t3.id from t1 left join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner; EXPLAIN -> Nested loop left join (cost=2.2 rows=9) - -> Index scan on t3 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t3 using PRIMARY (cost=0.55 rows=3) -> Nested loop inner join (cost=0.834 rows=3) -> Single-row index lookup on t1 using PRIMARY (id=t3.id) (cost=0.283 rows=1) -> Filter: (t2.`owner` = t3.id) (cost=0.184 rows=3) diff --git a/mysql-test/r/join_outer_bka.result b/mysql-test/r/join_outer_bka.result index 244146875e8..39a57318528 100644 --- a/mysql-test/r/join_outer_bka.result +++ b/mysql-test/r/join_outer_bka.result @@ -406,7 +406,7 @@ Thimble Smith Happy 3 3 explain format=tree select t1.name, t2.name, t2.id, t2.owner, t3.id from t1 left join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner; EXPLAIN -> Nested loop left join (cost=2.2 rows=9) - -> Index scan on t3 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t3 using PRIMARY (cost=0.55 rows=3) -> Nested loop inner join (cost=0.834 rows=3) -> Single-row index lookup on t1 using PRIMARY (id=t3.id) (cost=0.283 rows=1) -> Filter: (t2.`owner` = t3.id) (cost=0.184 rows=3) diff --git a/mysql-test/r/join_outer_bka_nobnl.result b/mysql-test/r/join_outer_bka_nobnl.result index 4acdcb1135d..1676cb9cc0a 100644 --- a/mysql-test/r/join_outer_bka_nobnl.result +++ b/mysql-test/r/join_outer_bka_nobnl.result @@ -406,7 +406,7 @@ Thimble Smith Happy 3 3 explain format=tree select t1.name, t2.name, t2.id, t2.owner, t3.id from t1 left join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner; EXPLAIN -> Nested loop left join (cost=2.2 rows=9) - -> Index scan on t3 using PRIMARY (cost=0.55 rows=3) + -> Covering index scan on t3 using PRIMARY (cost=0.55 rows=3) -> Nested loop inner join (cost=1.33 rows=3) -> Single-row index lookup on t1 using PRIMARY (id=t3.id) (cost=0.283 rows=1) -> Filter: (t2.`owner` = t3.id) (cost=0.35 rows=3) diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index af4dfaca1c6..8cf658ea7d3 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -830,7 +830,7 @@ EXPLAIN -> Sort: t1.a, t2.b -> Stream results (cost=0.8 rows=2) -> Inner hash join (no condition) (cost=0.8 rows=2) - -> Index scan on t1 using PRIMARY (cost=0.45 rows=2) + -> Covering index scan on t1 using PRIMARY (cost=0.45 rows=2) -> Hash -> Table scan on t2 (cost=0.35 rows=1) diff --git a/mysql-test/r/range_all.result b/mysql-test/r/range_all.result index f5efb52b230..80f773b496c 100644 --- a/mysql-test/r/range_all.result +++ b/mysql-test/r/range_all.result @@ -1997,7 +1997,7 @@ SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4; EXPLAIN -> Nested loop inner join (cost=1.6 rows=3) -> Filter: (t1.i4 is not null) (cost=0.55 rows=3) - -> Index scan on t1 using i4_uq (cost=0.55 rows=3) + -> Covering index scan on t1 using i4_uq (cost=0.55 rows=3) -> Filter: (t2.pk between t1.i4 and t1.i4) (cost=0.283 rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.i4) (cost=0.283 rows=1) @@ -4111,7 +4111,7 @@ SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4126,14 +4126,14 @@ explain format=tree SELECT 1 FROM t AS t1 JOIN (SELECT * FROM t WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; EXPLAIN --> Index scan on t1 using f1 (rows=4) +-> Covering index scan on t1 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; 1 @@ -4144,7 +4144,7 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4152,10 +4152,10 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 < NULL) (rows=4) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; 1 @@ -4168,7 +4168,7 @@ FROM t AS t1 LEFT JOIN (SELECT * FROM t AS t2 WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4176,9 +4176,9 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 < NULL) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4189,9 +4189,9 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 between 2 and 3) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON TRUE WHERE t1.f1 < NULL; EXPLAIN @@ -4205,7 +4205,7 @@ EXPLAIN -> Filter: (t1.f1 between 2 and 3) (rows=2) -> Covering index range scan on t1 using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t WHERE f1 < NULL) AS t1 LEFT JOIN t AS t2 ON TRUE; EXPLAIN @@ -4220,14 +4220,14 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 < NULL) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4239,9 +4239,9 @@ explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 between 2 and 3) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON TRUE @@ -4261,7 +4261,7 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN @@ -4269,13 +4269,13 @@ t AS t2 JOIN t AS t3 ON t2.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4292,13 +4292,13 @@ t AS t2 JOIN t AS t3 ON t3.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4315,11 +4315,11 @@ t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4329,11 +4329,11 @@ t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4343,13 +4343,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4366,13 +4366,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4389,11 +4389,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4403,11 +4403,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4417,11 +4417,11 @@ t AS t2 LEFT JOIN t AS t3 ON t3.f1 < NULL ON t1.f1 = t2.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4439,7 +4439,7 @@ ON t1.f1 = t2.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4451,11 +4451,11 @@ FROM t AS t1 LEFT JOIN ON t1.f1 = t4.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4474,7 +4474,7 @@ ON t1.f1 = t4.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4543,7 +4543,7 @@ EXPLAIN -> Materialize with deduplication (rows=8) -> Filter: (t2.f1 is not null) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4559,7 +4559,7 @@ EXPLAIN -> Materialize with deduplication (rows=8) -> Filter: (t2.f1 is not null) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=2) -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4611,7 +4611,7 @@ EXPLAIN -> Materialize with deduplication (rows=8) -> Filter: (t2.f1 is not null) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4631,7 +4631,7 @@ EXPLAIN -> Materialize with deduplication (rows=8) -> Filter: (t2.f1 is not null) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=2) -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4641,7 +4641,7 @@ FROM t AS t1 WHERE NOT EXISTS (SELECT * FROM t AS t2 WHERE t2.f1 < NULL AND t1.f1 = t2.f1); EXPLAIN -> Nested loop antijoin (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Filter: (t1.f1 < NULL) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4662,7 +4662,7 @@ FROM t AS t2 WHERE t2.f1 BETWEEN 2 AND 3 AND t1.f1 = t2.f1); EXPLAIN -> Nested loop antijoin (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Filter: (t1.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4676,7 +4676,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Nested loop antijoin (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Filter: (t1.f1 < NULL) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4702,7 +4702,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Nested loop antijoin (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Filter: (t1.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4715,15 +4715,15 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 < NULL WHERE t1.f1 = t2.f1); EXPLAIN -> Nested loop antijoin (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Single-row index lookup on using (f1=t1.f1) (rows=1) -> Materialize with deduplication (rows=4) -> Filter: (t2.f1 is not null) (rows=4) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=1) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) Warnings: Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1 @@ -4744,15 +4744,15 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 < NULL WHERE t1.f1 = t3.f1); EXPLAIN -> Nested loop antijoin (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Single-row index lookup on using (f1=t1.f1) (rows=1) -> Materialize with deduplication (rows=4) -> Filter: (t3.f1 is not null) (rows=4) -> Inner hash join (no condition) (rows=4) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) Warnings: Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1 @@ -4773,12 +4773,12 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Nested loop antijoin (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Single-row index lookup on using (f1=t1.f1) (rows=1) -> Materialize with deduplication (rows=8) -> Filter: (t2.f1 is not null) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4792,12 +4792,12 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Nested loop antijoin (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Single-row index lookup on using (f1=t1.f1) (rows=1) -> Materialize with deduplication (rows=8) -> Filter: (t2.f1 is not null) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=2) -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4813,15 +4813,15 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Nested loop antijoin (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Single-row index lookup on using (f1=t1.f1) (rows=1) -> Materialize with deduplication (rows=4) -> Filter: (t2.f1 is not null) (rows=4) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=1) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) Warnings: Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1 @@ -4846,15 +4846,15 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Nested loop antijoin (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Single-row index lookup on using (f1=t1.f1) (rows=1) -> Materialize with deduplication (rows=4) -> Filter: (t2.f1 is not null) (rows=4) -> Inner hash join (no condition) (rows=4) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) Warnings: Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1 @@ -4880,12 +4880,12 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Nested loop antijoin (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Single-row index lookup on using (f1=t1.f1) (rows=1) -> Materialize with deduplication (rows=8) -> Filter: (t2.f1 is not null) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4902,12 +4902,12 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Nested loop antijoin (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Single-row index lookup on using (f1=t1.f1) (rows=1) -> Materialize with deduplication (rows=8) -> Filter: (t2.f1 is not null) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=2) -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) diff --git a/mysql-test/r/range_icp.result b/mysql-test/r/range_icp.result index 113d8cacd9c..239266fee63 100644 --- a/mysql-test/r/range_icp.result +++ b/mysql-test/r/range_icp.result @@ -1997,7 +1997,7 @@ SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4; EXPLAIN -> Nested loop inner join (cost=1.6 rows=3) -> Filter: (t1.i4 is not null) (cost=0.55 rows=3) - -> Index scan on t1 using i4_uq (cost=0.55 rows=3) + -> Covering index scan on t1 using i4_uq (cost=0.55 rows=3) -> Filter: (t2.pk between t1.i4 and t1.i4) (cost=0.283 rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.i4) (cost=0.283 rows=1) @@ -4111,7 +4111,7 @@ SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4126,14 +4126,14 @@ explain format=tree SELECT 1 FROM t AS t1 JOIN (SELECT * FROM t WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; EXPLAIN --> Index scan on t1 using f1 (rows=4) +-> Covering index scan on t1 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; 1 @@ -4144,7 +4144,7 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4152,10 +4152,10 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 < NULL) (rows=4) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; 1 @@ -4168,7 +4168,7 @@ FROM t AS t1 LEFT JOIN (SELECT * FROM t AS t2 WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4176,9 +4176,9 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 < NULL) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4189,9 +4189,9 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 between 2 and 3) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON TRUE WHERE t1.f1 < NULL; EXPLAIN @@ -4205,7 +4205,7 @@ EXPLAIN -> Filter: (t1.f1 between 2 and 3) (rows=2) -> Covering index range scan on t1 using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t WHERE f1 < NULL) AS t1 LEFT JOIN t AS t2 ON TRUE; EXPLAIN @@ -4220,14 +4220,14 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 < NULL) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4239,9 +4239,9 @@ explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 between 2 and 3) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON TRUE @@ -4261,7 +4261,7 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN @@ -4269,13 +4269,13 @@ t AS t2 JOIN t AS t3 ON t2.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4292,13 +4292,13 @@ t AS t2 JOIN t AS t3 ON t3.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4315,11 +4315,11 @@ t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4329,11 +4329,11 @@ t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4343,13 +4343,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4366,13 +4366,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4389,11 +4389,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4403,11 +4403,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4417,11 +4417,11 @@ t AS t2 LEFT JOIN t AS t3 ON t3.f1 < NULL ON t1.f1 = t2.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4439,7 +4439,7 @@ ON t1.f1 = t2.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4451,11 +4451,11 @@ FROM t AS t1 LEFT JOIN ON t1.f1 = t4.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4474,7 +4474,7 @@ ON t1.f1 = t4.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4557,7 +4557,7 @@ EXPLAIN -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=(t.f2)) (rows=1) @@ -4627,7 +4627,7 @@ EXPLAIN -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=(t.f2)) (rows=1) @@ -4655,7 +4655,7 @@ FROM t AS t1 WHERE NOT EXISTS (SELECT * FROM t AS t2 WHERE t2.f1 < NULL AND t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4676,7 +4676,7 @@ FROM t AS t2 WHERE t2.f1 BETWEEN 2 AND 3 AND t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Filter: (t2.f1 between 2 and 3) (rows=1) @@ -4692,7 +4692,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4718,7 +4718,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Filter: (t2.f1 between 2 and 3) (rows=1) @@ -4733,7 +4733,7 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 < NULL WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4756,7 +4756,7 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 < NULL WHERE t1.f1 = t3.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4779,11 +4779,11 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4797,7 +4797,7 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=2) @@ -4817,7 +4817,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4844,7 +4844,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4872,11 +4872,11 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4893,7 +4893,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=2) diff --git a/mysql-test/r/range_icp_mrr.result b/mysql-test/r/range_icp_mrr.result index 8f1ea6f8763..eced1cba161 100644 --- a/mysql-test/r/range_icp_mrr.result +++ b/mysql-test/r/range_icp_mrr.result @@ -1997,7 +1997,7 @@ SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4; EXPLAIN -> Nested loop inner join (cost=1.6 rows=3) -> Filter: (t1.i4 is not null) (cost=0.55 rows=3) - -> Index scan on t1 using i4_uq (cost=0.55 rows=3) + -> Covering index scan on t1 using i4_uq (cost=0.55 rows=3) -> Filter: (t2.pk between t1.i4 and t1.i4) (cost=0.283 rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.i4) (cost=0.283 rows=1) @@ -4111,7 +4111,7 @@ SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4126,14 +4126,14 @@ explain format=tree SELECT 1 FROM t AS t1 JOIN (SELECT * FROM t WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; EXPLAIN --> Index scan on t1 using f1 (rows=4) +-> Covering index scan on t1 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; 1 @@ -4144,7 +4144,7 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4152,10 +4152,10 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 < NULL) (rows=4) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; 1 @@ -4168,7 +4168,7 @@ FROM t AS t1 LEFT JOIN (SELECT * FROM t AS t2 WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4176,9 +4176,9 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 < NULL) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4189,9 +4189,9 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 between 2 and 3) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON TRUE WHERE t1.f1 < NULL; EXPLAIN @@ -4205,7 +4205,7 @@ EXPLAIN -> Filter: (t1.f1 between 2 and 3) (rows=2) -> Covering index range scan on t1 using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t WHERE f1 < NULL) AS t1 LEFT JOIN t AS t2 ON TRUE; EXPLAIN @@ -4220,14 +4220,14 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 < NULL) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4239,9 +4239,9 @@ explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 between 2 and 3) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON TRUE @@ -4261,7 +4261,7 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN @@ -4269,13 +4269,13 @@ t AS t2 JOIN t AS t3 ON t2.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4292,13 +4292,13 @@ t AS t2 JOIN t AS t3 ON t3.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4315,11 +4315,11 @@ t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4329,11 +4329,11 @@ t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4343,13 +4343,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4366,13 +4366,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4389,11 +4389,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4403,11 +4403,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4417,11 +4417,11 @@ t AS t2 LEFT JOIN t AS t3 ON t3.f1 < NULL ON t1.f1 = t2.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4439,7 +4439,7 @@ ON t1.f1 = t2.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4451,11 +4451,11 @@ FROM t AS t1 LEFT JOIN ON t1.f1 = t4.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4474,7 +4474,7 @@ ON t1.f1 = t4.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4557,7 +4557,7 @@ EXPLAIN -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=(t.f2)) (rows=1) @@ -4627,7 +4627,7 @@ EXPLAIN -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=(t.f2)) (rows=1) @@ -4655,7 +4655,7 @@ FROM t AS t1 WHERE NOT EXISTS (SELECT * FROM t AS t2 WHERE t2.f1 < NULL AND t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4676,7 +4676,7 @@ FROM t AS t2 WHERE t2.f1 BETWEEN 2 AND 3 AND t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Filter: (t2.f1 between 2 and 3) (rows=1) @@ -4692,7 +4692,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4718,7 +4718,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Filter: (t2.f1 between 2 and 3) (rows=1) @@ -4733,7 +4733,7 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 < NULL WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4756,7 +4756,7 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 < NULL WHERE t1.f1 = t3.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4779,11 +4779,11 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4797,7 +4797,7 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=2) @@ -4817,7 +4817,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4844,7 +4844,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4872,11 +4872,11 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4893,7 +4893,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=2) diff --git a/mysql-test/r/range_mrr.result b/mysql-test/r/range_mrr.result index cae0a950b09..62670c3e5f1 100644 --- a/mysql-test/r/range_mrr.result +++ b/mysql-test/r/range_mrr.result @@ -1997,7 +1997,7 @@ SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4; EXPLAIN -> Nested loop inner join (cost=1.6 rows=3) -> Filter: (t1.i4 is not null) (cost=0.55 rows=3) - -> Index scan on t1 using i4_uq (cost=0.55 rows=3) + -> Covering index scan on t1 using i4_uq (cost=0.55 rows=3) -> Filter: (t2.pk between t1.i4 and t1.i4) (cost=0.283 rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.i4) (cost=0.283 rows=1) @@ -4112,7 +4112,7 @@ SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4127,14 +4127,14 @@ explain format=tree SELECT 1 FROM t AS t1 JOIN (SELECT * FROM t WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; EXPLAIN --> Index scan on t1 using f1 (rows=4) +-> Covering index scan on t1 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; 1 @@ -4145,7 +4145,7 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4153,10 +4153,10 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 < NULL) (rows=4) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; 1 @@ -4169,7 +4169,7 @@ FROM t AS t1 LEFT JOIN (SELECT * FROM t AS t2 WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4177,9 +4177,9 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 < NULL) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4190,9 +4190,9 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 between 2 and 3) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON TRUE WHERE t1.f1 < NULL; EXPLAIN @@ -4206,7 +4206,7 @@ EXPLAIN -> Filter: (t1.f1 between 2 and 3) (rows=2) -> Covering index range scan on t1 using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t WHERE f1 < NULL) AS t1 LEFT JOIN t AS t2 ON TRUE; EXPLAIN @@ -4221,14 +4221,14 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 < NULL) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4240,9 +4240,9 @@ explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 between 2 and 3) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON TRUE @@ -4262,7 +4262,7 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN @@ -4270,13 +4270,13 @@ t AS t2 JOIN t AS t3 ON t2.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4293,13 +4293,13 @@ t AS t2 JOIN t AS t3 ON t3.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4316,11 +4316,11 @@ t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4330,11 +4330,11 @@ t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4344,13 +4344,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4367,13 +4367,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4390,11 +4390,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4404,11 +4404,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4418,11 +4418,11 @@ t AS t2 LEFT JOIN t AS t3 ON t3.f1 < NULL ON t1.f1 = t2.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4440,7 +4440,7 @@ ON t1.f1 = t2.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4452,11 +4452,11 @@ FROM t AS t1 LEFT JOIN ON t1.f1 = t4.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4475,7 +4475,7 @@ ON t1.f1 = t4.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4558,7 +4558,7 @@ EXPLAIN -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=(t.f2)) (rows=1) @@ -4628,7 +4628,7 @@ EXPLAIN -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=(t.f2)) (rows=1) @@ -4656,7 +4656,7 @@ FROM t AS t1 WHERE NOT EXISTS (SELECT * FROM t AS t2 WHERE t2.f1 < NULL AND t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4677,7 +4677,7 @@ FROM t AS t2 WHERE t2.f1 BETWEEN 2 AND 3 AND t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Filter: (t2.f1 between 2 and 3) (rows=1) @@ -4693,7 +4693,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4719,7 +4719,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Filter: (t2.f1 between 2 and 3) (rows=1) @@ -4734,7 +4734,7 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 < NULL WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4757,7 +4757,7 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 < NULL WHERE t1.f1 = t3.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4780,11 +4780,11 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4798,7 +4798,7 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=2) @@ -4818,7 +4818,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4845,7 +4845,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4873,11 +4873,11 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4894,7 +4894,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=2) diff --git a/mysql-test/r/range_mrr_cost.result b/mysql-test/r/range_mrr_cost.result index b7fb8eea402..5bba1988c54 100644 --- a/mysql-test/r/range_mrr_cost.result +++ b/mysql-test/r/range_mrr_cost.result @@ -1997,7 +1997,7 @@ SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4; EXPLAIN -> Nested loop inner join (cost=1.6 rows=3) -> Filter: (t1.i4 is not null) (cost=0.55 rows=3) - -> Index scan on t1 using i4_uq (cost=0.55 rows=3) + -> Covering index scan on t1 using i4_uq (cost=0.55 rows=3) -> Filter: (t2.pk between t1.i4 and t1.i4) (cost=0.283 rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.i4) (cost=0.283 rows=1) @@ -4112,7 +4112,7 @@ SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4127,14 +4127,14 @@ explain format=tree SELECT 1 FROM t AS t1 JOIN (SELECT * FROM t WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; EXPLAIN --> Index scan on t1 using f1 (rows=4) +-> Covering index scan on t1 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; 1 @@ -4145,7 +4145,7 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4153,10 +4153,10 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 < NULL) (rows=4) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; 1 @@ -4169,7 +4169,7 @@ FROM t AS t1 LEFT JOIN (SELECT * FROM t AS t2 WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4177,9 +4177,9 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 < NULL) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4190,9 +4190,9 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 between 2 and 3) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON TRUE WHERE t1.f1 < NULL; EXPLAIN @@ -4206,7 +4206,7 @@ EXPLAIN -> Filter: (t1.f1 between 2 and 3) (rows=2) -> Covering index range scan on t1 using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t WHERE f1 < NULL) AS t1 LEFT JOIN t AS t2 ON TRUE; EXPLAIN @@ -4221,14 +4221,14 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 < NULL) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4240,9 +4240,9 @@ explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 between 2 and 3) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON TRUE @@ -4262,7 +4262,7 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN @@ -4270,13 +4270,13 @@ t AS t2 JOIN t AS t3 ON t2.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4293,13 +4293,13 @@ t AS t2 JOIN t AS t3 ON t3.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4316,11 +4316,11 @@ t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4330,11 +4330,11 @@ t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4344,13 +4344,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4367,13 +4367,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4390,11 +4390,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4404,11 +4404,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4418,11 +4418,11 @@ t AS t2 LEFT JOIN t AS t3 ON t3.f1 < NULL ON t1.f1 = t2.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4440,7 +4440,7 @@ ON t1.f1 = t2.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4452,11 +4452,11 @@ FROM t AS t1 LEFT JOIN ON t1.f1 = t4.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4475,7 +4475,7 @@ ON t1.f1 = t4.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4558,7 +4558,7 @@ EXPLAIN -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=(t.f2)) (rows=1) @@ -4628,7 +4628,7 @@ EXPLAIN -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=(t.f2)) (rows=1) @@ -4656,7 +4656,7 @@ FROM t AS t1 WHERE NOT EXISTS (SELECT * FROM t AS t2 WHERE t2.f1 < NULL AND t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4677,7 +4677,7 @@ FROM t AS t2 WHERE t2.f1 BETWEEN 2 AND 3 AND t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Filter: (t2.f1 between 2 and 3) (rows=1) @@ -4693,7 +4693,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4719,7 +4719,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Filter: (t2.f1 between 2 and 3) (rows=1) @@ -4734,7 +4734,7 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 < NULL WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4757,7 +4757,7 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 < NULL WHERE t1.f1 = t3.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4780,11 +4780,11 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4798,7 +4798,7 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=2) @@ -4818,7 +4818,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4845,7 +4845,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4873,11 +4873,11 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4894,7 +4894,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=2) diff --git a/mysql-test/r/range_none.result b/mysql-test/r/range_none.result index d469658b948..fa29e3a57d0 100644 --- a/mysql-test/r/range_none.result +++ b/mysql-test/r/range_none.result @@ -1996,7 +1996,7 @@ SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4; EXPLAIN -> Nested loop inner join (cost=1.6 rows=3) -> Filter: (t1.i4 is not null) (cost=0.55 rows=3) - -> Index scan on t1 using i4_uq (cost=0.55 rows=3) + -> Covering index scan on t1 using i4_uq (cost=0.55 rows=3) -> Filter: (t2.pk between t1.i4 and t1.i4) (cost=0.283 rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.i4) (cost=0.283 rows=1) @@ -4111,7 +4111,7 @@ SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4126,14 +4126,14 @@ explain format=tree SELECT 1 FROM t AS t1 JOIN (SELECT * FROM t WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Inner hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; EXPLAIN --> Index scan on t1 using f1 (rows=4) +-> Covering index scan on t1 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; 1 @@ -4144,7 +4144,7 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t2.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4152,10 +4152,10 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t.f1 < NULL) (rows=4) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN (SELECT * FROM t WHERE f1 < NULL) AS t2 ON TRUE; 1 @@ -4168,7 +4168,7 @@ FROM t AS t1 LEFT JOIN (SELECT * FROM t AS t2 WHERE f1 BETWEEN 2 AND 3) AS t2 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=2) -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4176,9 +4176,9 @@ EXPLAIN explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 < NULL) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4189,9 +4189,9 @@ SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t1.f1 between 2 and 3) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN t AS t2 ON TRUE WHERE t1.f1 < NULL; EXPLAIN @@ -4205,7 +4205,7 @@ EXPLAIN -> Filter: (t1.f1 between 2 and 3) (rows=2) -> Covering index range scan on t1 using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t WHERE f1 < NULL) AS t1 LEFT JOIN t AS t2 ON TRUE; EXPLAIN @@ -4220,14 +4220,14 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 < NULL) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 < NULL; 1 @@ -4239,9 +4239,9 @@ explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON t1.f1 BETWEEN 2 AND 3; EXPLAIN -> Left hash join (no condition), extra conditions: (t.f1 between 2 and 3) (rows=16) - -> Index scan on t using f1 (rows=4) + -> Covering index scan on t using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM (SELECT * FROM t) AS t1 LEFT JOIN t AS t2 ON TRUE @@ -4261,7 +4261,7 @@ EXPLAIN -> Filter: (t.f1 between 2 and 3) (rows=2) -> Covering index range scan on t using f1 over (2 <= f1 <= 3) (rows=2) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) explain format=tree SELECT 1 FROM t AS t1 LEFT JOIN @@ -4269,13 +4269,13 @@ t AS t2 JOIN t AS t3 ON t2.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4292,13 +4292,13 @@ t AS t2 JOIN t AS t3 ON t3.f1 < NULL ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4315,11 +4315,11 @@ t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4329,11 +4329,11 @@ t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4343,13 +4343,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4366,13 +4366,13 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=16) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 < NULL) (rows=16) -> Inner hash join (no condition) (rows=16) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4389,11 +4389,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Covering index range scan on t2 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4403,11 +4403,11 @@ FROM t AS t1 LEFT JOIN ON TRUE; EXPLAIN -> Left hash join (no condition) (rows=32) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Hash -> Filter: (t3.f1 between 2 and 3) (rows=8) -> Inner hash join (no condition) (rows=8) - -> Index scan on t2 using f1 (rows=4) + -> Covering index scan on t2 using f1 (rows=4) -> Hash -> Covering index range scan on t3 using f1 over (2 <= f1 <= 3) (rows=2) @@ -4417,11 +4417,11 @@ t AS t2 LEFT JOIN t AS t3 ON t3.f1 < NULL ON t1.f1 = t2.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4439,7 +4439,7 @@ ON t1.f1 = t2.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4451,11 +4451,11 @@ FROM t AS t1 LEFT JOIN ON t1.f1 = t4.f1; EXPLAIN -> Nested loop left join (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 < NULL) (rows=1) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) SELECT 1 FROM t AS t1 LEFT JOIN @@ -4474,7 +4474,7 @@ ON t1.f1 = t4.f1; EXPLAIN -> Filter: (found_match(t3), true, true) (rows=8) -> Nested loop left join (rows=8) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Nested loop left join (rows=2) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) -> Filter: (t3.f1 between 2 and 3) (rows=2) @@ -4557,7 +4557,7 @@ EXPLAIN -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=(t.f2)) (rows=1) @@ -4627,7 +4627,7 @@ EXPLAIN -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=(t.f2)) (rows=1) @@ -4655,7 +4655,7 @@ FROM t AS t1 WHERE NOT EXISTS (SELECT * FROM t AS t2 WHERE t2.f1 < NULL AND t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4676,7 +4676,7 @@ FROM t AS t2 WHERE t2.f1 BETWEEN 2 AND 3 AND t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Filter: (t2.f1 between 2 and 3) (rows=1) @@ -4692,7 +4692,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4718,7 +4718,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Filter: (t2.f1 between 2 and 3) (rows=1) @@ -4733,7 +4733,7 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 < NULL WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4756,7 +4756,7 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 < NULL WHERE t1.f1 = t3.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4779,11 +4779,11 @@ FROM t AS t2 JOIN t AS t3 ON t2.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4797,7 +4797,7 @@ FROM t AS t2 JOIN t AS t3 ON t3.f1 BETWEEN 2 AND 3 WHERE t1.f1 = t2.f1); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=2) @@ -4817,7 +4817,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4844,7 +4844,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Zero rows (no matching row in const table) (rows=0) @@ -4872,11 +4872,11 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=4) - -> Index scan on t3 using f1 (rows=4) + -> Covering index scan on t3 using f1 (rows=4) -> Hash -> Filter: (t2.f1 between 2 and 3) (rows=1) -> Covering index lookup on t2 using f1 (f1=t1.f1) (rows=1) @@ -4893,7 +4893,7 @@ WHERE t1.f1 = t4.f1 ); EXPLAIN -> Filter: exists(select #2) is false (rows=4) - -> Index scan on t1 using f1 (rows=4) + -> Covering index scan on t1 using f1 (rows=4) -> Select #2 (subquery in condition; dependent) -> Limit: 1 row(s) (rows=1) -> Inner hash join (no condition) (rows=2) diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 0f1b5cafbde..896cabfde3c 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -339,7 +339,7 @@ Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`t EXPLAIN FORMAT=tree SELECT * FROM t1,t2 WHERE t1.a=t2.a AND t1.b=t2.b; EXPLAIN -> Nested loop inner join (cost=3.4 rows=7) - -> Index scan on t2 using PRIMARY (cost=0.95 rows=7) + -> Covering index scan on t2 using PRIMARY (cost=0.95 rows=7) -> Single-row covering index lookup on t1 using PRIMARY (a=t2.a, b=t2.b) (cost=0.264 rows=1) EXPLAIN SELECT * FROM t1,t2 WHERE (t1.a,t1.b)=(t2.a,t2.b); @@ -351,7 +351,7 @@ Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`t EXPLAIN FORMAT=tree SELECT * FROM t1,t2 WHERE (t1.a,t1.b)=(t2.a,t2.b); EXPLAIN -> Nested loop inner join (cost=3.4 rows=7) - -> Index scan on t2 using PRIMARY (cost=0.95 rows=7) + -> Covering index scan on t2 using PRIMARY (cost=0.95 rows=7) -> Single-row covering index lookup on t1 using PRIMARY (a=t2.a, b=t2.b) (cost=0.264 rows=1) SELECT * FROM t1,t2 WHERE t1.a=t2.a and t1.b=t2.b; diff --git a/mysql-test/r/select_all.result b/mysql-test/r/select_all.result index 6bc9b73b831..3268f43e2d2 100644 --- a/mysql-test/r/select_all.result +++ b/mysql-test/r/select_all.result @@ -2120,7 +2120,7 @@ explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0 EXPLAIN -> Aggregate: min(t2.fld1), max(t2.fld1), count(0) (cost=244 rows=1) -> Filter: (rand() > 0.5) (cost=124 rows=1199) - -> Index scan on t2 using fld1 (cost=124 rows=1199) + -> Covering index scan on t2 using fld1 (cost=124 rows=1199) select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) diff --git a/mysql-test/r/select_all_bka.result b/mysql-test/r/select_all_bka.result index 89f615ee898..b35633c9612 100644 --- a/mysql-test/r/select_all_bka.result +++ b/mysql-test/r/select_all_bka.result @@ -2121,7 +2121,7 @@ explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0 EXPLAIN -> Aggregate: min(t2.fld1), max(t2.fld1), count(0) (cost=244 rows=1) -> Filter: (rand() > 0.5) (cost=124 rows=1199) - -> Index scan on t2 using fld1 (cost=124 rows=1199) + -> Covering index scan on t2 using fld1 (cost=124 rows=1199) select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) diff --git a/mysql-test/r/select_all_bka_nobnl.result b/mysql-test/r/select_all_bka_nobnl.result index d66212cd0e4..ef998621226 100644 --- a/mysql-test/r/select_all_bka_nobnl.result +++ b/mysql-test/r/select_all_bka_nobnl.result @@ -2121,7 +2121,7 @@ explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0 EXPLAIN -> Aggregate: min(t2.fld1), max(t2.fld1), count(0) (cost=244 rows=1) -> Filter: (rand() > 0.5) (cost=124 rows=1199) - -> Index scan on t2 using fld1 (cost=124 rows=1199) + -> Covering index scan on t2 using fld1 (cost=124 rows=1199) select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) diff --git a/mysql-test/r/select_icp_mrr.result b/mysql-test/r/select_icp_mrr.result index 1d1e4cb11e4..439fdc422b0 100644 --- a/mysql-test/r/select_icp_mrr.result +++ b/mysql-test/r/select_icp_mrr.result @@ -2120,7 +2120,7 @@ explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0 EXPLAIN -> Aggregate: min(t2.fld1), max(t2.fld1), count(0) (cost=244 rows=1) -> Filter: (rand() > 0.5) (cost=124 rows=1199) - -> Index scan on t2 using fld1 (cost=124 rows=1199) + -> Covering index scan on t2 using fld1 (cost=124 rows=1199) select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) diff --git a/mysql-test/r/select_icp_mrr_bka.result b/mysql-test/r/select_icp_mrr_bka.result index 252607ffae0..762820ac8fd 100644 --- a/mysql-test/r/select_icp_mrr_bka.result +++ b/mysql-test/r/select_icp_mrr_bka.result @@ -2121,7 +2121,7 @@ explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0 EXPLAIN -> Aggregate: min(t2.fld1), max(t2.fld1), count(0) (cost=244 rows=1) -> Filter: (rand() > 0.5) (cost=124 rows=1199) - -> Index scan on t2 using fld1 (cost=124 rows=1199) + -> Covering index scan on t2 using fld1 (cost=124 rows=1199) select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) diff --git a/mysql-test/r/select_icp_mrr_bka_nobnl.result b/mysql-test/r/select_icp_mrr_bka_nobnl.result index 9ab221782dd..669666d42f6 100644 --- a/mysql-test/r/select_icp_mrr_bka_nobnl.result +++ b/mysql-test/r/select_icp_mrr_bka_nobnl.result @@ -2121,7 +2121,7 @@ explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0 EXPLAIN -> Aggregate: min(t2.fld1), max(t2.fld1), count(0) (cost=244 rows=1) -> Filter: (rand() > 0.5) (cost=124 rows=1199) - -> Index scan on t2 using fld1 (cost=124 rows=1199) + -> Covering index scan on t2 using fld1 (cost=124 rows=1199) select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) diff --git a/mysql-test/r/select_none.result b/mysql-test/r/select_none.result index c490356fa20..7759b0866f5 100644 --- a/mysql-test/r/select_none.result +++ b/mysql-test/r/select_none.result @@ -2119,7 +2119,7 @@ explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0 EXPLAIN -> Aggregate: min(t2.fld1), max(t2.fld1), count(0) (cost=244 rows=1) -> Filter: (rand() > 0.5) (cost=124 rows=1199) - -> Index scan on t2 using fld1 (cost=124 rows=1199) + -> Covering index scan on t2 using fld1 (cost=124 rows=1199) select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) diff --git a/mysql-test/r/select_none_bka.result b/mysql-test/r/select_none_bka.result index 21d3542afc2..0063133cc42 100644 --- a/mysql-test/r/select_none_bka.result +++ b/mysql-test/r/select_none_bka.result @@ -2120,7 +2120,7 @@ explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0 EXPLAIN -> Aggregate: min(t2.fld1), max(t2.fld1), count(0) (cost=244 rows=1) -> Filter: (rand() > 0.5) (cost=124 rows=1199) - -> Index scan on t2 using fld1 (cost=124 rows=1199) + -> Covering index scan on t2 using fld1 (cost=124 rows=1199) select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) diff --git a/mysql-test/r/select_none_bka_nobnl.result b/mysql-test/r/select_none_bka_nobnl.result index 05fdad98125..9fbda8c9910 100644 --- a/mysql-test/r/select_none_bka_nobnl.result +++ b/mysql-test/r/select_none_bka_nobnl.result @@ -2120,7 +2120,7 @@ explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0 EXPLAIN -> Aggregate: min(t2.fld1), max(t2.fld1), count(0) (cost=244 rows=1) -> Filter: (rand() > 0.5) (cost=124 rows=1199) - -> Index scan on t2 using fld1 (cost=124 rows=1199) + -> Covering index scan on t2 using fld1 (cost=124 rows=1199) select min(fld1),max(fld1),count(*) from t2; min(fld1) max(fld1) count(*) diff --git a/mysql-test/r/subplan_tokens.result b/mysql-test/r/subplan_tokens.result index 3c1dc1d0f63..c283a083b5d 100644 --- a/mysql-test/r/subplan_tokens.result +++ b/mysql-test/r/subplan_tokens.result @@ -13,10 +13,10 @@ SET DEBUG='+d,subplan_tokens,force_subplan_0xeed2c0bd3e39ba93'; EXPLAIN FORMAT=tree SELECT * FROM t1 ORDER BY a; EXPLAIN --> [0x2215d3ce44f01b0d] Index scan on t1 using a (cost=0.0836..0.251 rows=3) +-> [0x6d8e7db8c811fc24] Covering index scan on t1 using a (cost=0.0836..0.251 rows=3) To force this plan, use: -SET DEBUG='+d,subplan_tokens,force_subplan_0x2215d3ce44f01b0d'; +SET DEBUG='+d,subplan_tokens,force_subplan_0x6d8e7db8c811fc24'; SET DEBUG='+d,subplan_tokens,force_subplan_0xeed2c0bd3e39ba93'; EXPLAIN FORMAT=tree SELECT * FROM t1 ORDER BY a; @@ -46,7 +46,7 @@ SET DEBUG='-d,subplan_tokens'; EXPLAIN FORMAT=tree SELECT * FROM t1 JOIN t1 AS t2 ON t1.a=t2.a ORDER BY t1.a; EXPLAIN -> Nested loop inner join (cost=0.334..1 rows=3) - -> Index scan on t2 using a (cost=0.0836..0.251 rows=3) - -> Index lookup on t1 using a (a=t2.a) (cost=0.25..0.25 rows=1) + -> Covering index scan on t2 using a (cost=0.0836..0.251 rows=3) + -> Covering index lookup on t1 using a (a=t2.a) (cost=0.25..0.25 rows=1) DROP TABLE t1; diff --git a/mysql-test/r/subquery_bugs.result b/mysql-test/r/subquery_bugs.result index 275221fe9e6..eafda9b4386 100644 --- a/mysql-test/r/subquery_bugs.result +++ b/mysql-test/r/subquery_bugs.result @@ -649,7 +649,7 @@ EXPLAIN -> Index range scan on t1 using PRIMARY over (80 < pk) (cost=0.46 rows=1) -> Nested loop inner join (cost=0.775 rows=2) -> Table scan on t5 (cost=0.45 rows=1) - -> Index scan on t4 using PRIMARY (cost=1.3 rows=2) + -> Covering index scan on t4 using PRIMARY (cost=1.3 rows=2) -> Nested loop semijoin (cost=0.8 rows=1) -> Single-row index lookup on t3 using PRIMARY (pk=t1.pk) (cost=0.45 rows=1) -> Filter: (t2.f2 = t1.f2) (cost=0.7 rows=1) @@ -782,7 +782,7 @@ EXPLAIN -> Single-row index lookup on using (pk=t1.pk) (cost=1.64..1.64 rows=1) -> Materialize with deduplication (cost=1.6..1.6 rows=5) -> Nested loop left join (cost=1.1 rows=5) - -> Index scan on t2 using PRIMARY (cost=0.35 rows=1) + -> Covering index scan on t2 using PRIMARY (cost=0.35 rows=1) -> Nested loop left join (cost=2.5 rows=5) -> Filter: (t3.col_int_key <> t2.pk) (cost=0.75 rows=5) -> Table scan on t3 (cost=0.75 rows=5) @@ -911,11 +911,11 @@ t1 AS t2 LEFT JOIN t1 AS t3 USING (f2) WHERE t2.f1 > table1.f2 ) FROM t1 AS table1; EXPLAIN --> Index scan on table1 using f2_idx (cost=0.35 rows=1) +-> Covering index scan on table1 using f2_idx (cost=0.35 rows=1) -> Select #2 (subquery in projection; dependent) -> Nested loop inner join (cost=1.05 rows=1) -> Nested loop inner join (cost=0.7 rows=1) - -> Index scan on t1 using f2_idx (cost=0.35 rows=1) + -> Covering index scan on t1 using f2_idx (cost=0.35 rows=1) -> Filter: (cast(t2.f1 as double) > cast(table1.f2 as double)) (cost=0.35 rows=1) -> Index range scan on t2 (re-planned for each iteration) (cost=0.35 rows=1) -> Covering index lookup on t3 using f2_idx (f2=t2.f2) (cost=0.35 rows=1) @@ -1117,7 +1117,7 @@ GROUP BY table_user.id ) AS d ) AS users FROM table_city; EXPLAIN --> Index scan on table_city using PRIMARY (rows=6) +-> Covering index scan on table_city using PRIMARY (rows=6) -> Select #2 (subquery in projection; dependent) -> Aggregate: group_concat(d.id separator ',') (rows=1) -> Table scan on d (rows=5) @@ -1177,7 +1177,7 @@ EXPLAIN -> Sort: d.c -> Stream results (cost=1.55 rows=4) -> Inner hash join (no condition) (cost=1.55 rows=4) - -> Index scan on c using idx_c (cost=0.45 rows=2) + -> Covering index scan on c using idx_c (cost=0.45 rows=2) -> Hash -> Nested loop inner join (cost=0.9 rows=2) -> Filter: (``.c is not null) (cost=1.2..0.2 rows=2) @@ -1185,10 +1185,10 @@ EXPLAIN -> Materialize with deduplication (cost=2.2..2.2 rows=4) -> Filter: (b.c is not null) (cost=1.8 rows=4) -> Inner hash join (no condition) (cost=1.8 rows=4) - -> Index scan on c_inner_inner using idx_c (cost=0.225 rows=2) + -> Covering index scan on c_inner_inner using idx_c (cost=0.225 rows=2) -> Hash -> Nested loop left join (cost=1.15 rows=2) - -> Index scan on b using idx_b (cost=0.45 rows=2) + -> Covering index scan on b using idx_b (cost=0.45 rows=2) -> Covering index lookup on c_inner using idx_c (c=b.c) (cost=0.3 rows=1) -> Covering index lookup on d using idx_d (c=``.c) (cost=0.6 rows=1) @@ -1422,7 +1422,7 @@ EXPLAIN -> Remove duplicate t1 rows using temporary table (weedout) (cost=1.05 rows=1) -> Filter: (cast(t1.col1 as double) = (t1.col1 + t2.col2)) (cost=1.05 rows=1) -> Inner hash join (no condition) (cost=1.05 rows=1) - -> Index scan on t1 using col1_idx (cost=0.35 rows=1) + -> Covering index scan on t1 using col1_idx (cost=0.35 rows=1) -> Hash -> Nested loop inner join (cost=0.7 rows=1) -> Filter: ((t3.col2 between 2 and 9) and (t3.col1 is not null)) (cost=0.35 rows=1) @@ -1467,7 +1467,7 @@ EXPLAIN -> Limit: 1 row(s) (cost=3.45..3.45 rows=1) -> Index lookup on using (field4=(t1.col_int_key + 6)) -> Materialize with deduplication (cost=3.45..3.45 rows=16) - -> Index scan on table1s using col_int_unique (cost=1.85 rows=16) + -> Covering index scan on table1s using col_int_unique (cost=1.85 rows=16) -> Single-row covering index lookup on t3 using PRIMARY (pk=t1.col_int_key) (cost=0.35 rows=1) -> Index lookup on t2 using col_int_key (col_int_key=t1.col_int_key) (cost=0.4 rows=1.14) @@ -1790,7 +1790,7 @@ EXPLAIN FORMAT=tree SELECT 1 FROM t1 WHERE d IN (SELECT a FROM t1); EXPLAIN -> Remove duplicate t1 rows using temporary table (weedout) (cost=1.1 rows=2) -> Inner hash join (cast(t1.d as double) = cast(t1.a as double)) (cost=1.1 rows=2) - -> Index scan on t1 using PRIMARY (cost=0.35 rows=2) + -> Covering index scan on t1 using PRIMARY (cost=0.35 rows=2) -> Hash -> Table scan on t1 (cost=0.45 rows=2) diff --git a/mysql-test/r/subquery_sj_all.result b/mysql-test/r/subquery_sj_all.result index 9fbdd4accc7..69490651859 100644 --- a/mysql-test/r/subquery_sj_all.result +++ b/mysql-test/r/subquery_sj_all.result @@ -13179,7 +13179,7 @@ EXPLAIN -> Hash -> Filter: (t3.col_int is null) (rows=7) -> Nested loop left join (rows=7) - -> Index scan on t1 using col_int_key (rows=7) + -> Covering index scan on t1 using col_int_key (rows=7) -> Nested loop inner join (rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.pk) (rows=1) -> Filter: (t3.col_int_key = t2.col_int) (rows=1) diff --git a/mysql-test/r/subquery_sj_all_bka.result b/mysql-test/r/subquery_sj_all_bka.result index 594ef685c0a..912dc59fccd 100644 --- a/mysql-test/r/subquery_sj_all_bka.result +++ b/mysql-test/r/subquery_sj_all_bka.result @@ -13182,7 +13182,7 @@ EXPLAIN -> Hash -> Filter: (t3.col_int is null) (rows=7) -> Nested loop left join (rows=7) - -> Index scan on t1 using col_int_key (rows=7) + -> Covering index scan on t1 using col_int_key (rows=7) -> Nested loop inner join (rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.pk) (rows=1) -> Filter: (t3.col_int_key = t2.col_int) (rows=1) diff --git a/mysql-test/r/subquery_sj_all_bka_nobnl.result b/mysql-test/r/subquery_sj_all_bka_nobnl.result index 80045176da0..471b70e97dc 100644 --- a/mysql-test/r/subquery_sj_all_bka_nobnl.result +++ b/mysql-test/r/subquery_sj_all_bka_nobnl.result @@ -13175,7 +13175,7 @@ EXPLAIN -> Nested loop inner join (rows=7) -> Filter: (t3.col_int is null) (rows=7) -> Nested loop left join (rows=7) - -> Index scan on t1 using col_int_key (rows=7) + -> Covering index scan on t1 using col_int_key (rows=7) -> Nested loop inner join (rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.pk) (rows=1) -> Index lookup on t3 using col_int_key (col_int_key=t2.col_int) (rows=1) diff --git a/mysql-test/r/subquery_sj_loosescan.result b/mysql-test/r/subquery_sj_loosescan.result index d1bbd0fc99d..74f952fd365 100644 --- a/mysql-test/r/subquery_sj_loosescan.result +++ b/mysql-test/r/subquery_sj_loosescan.result @@ -13091,7 +13091,7 @@ EXPLAIN -> Inner hash join (t4.col_int_key = t1.col_int_key) (rows=7) -> Table scan on t4 (rows=6) -> Hash - -> Index scan on t1 using col_int_key (rows=7) + -> Covering index scan on t1 using col_int_key (rows=7) -> Nested loop inner join (rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.pk) (rows=1) -> Filter: (t3.col_int_key = t2.col_int) (rows=1) diff --git a/mysql-test/r/subquery_sj_loosescan_bka.result b/mysql-test/r/subquery_sj_loosescan_bka.result index 0301ab8b9bd..44e69f33770 100644 --- a/mysql-test/r/subquery_sj_loosescan_bka.result +++ b/mysql-test/r/subquery_sj_loosescan_bka.result @@ -13092,7 +13092,7 @@ EXPLAIN -> Inner hash join (t4.col_int_key = t1.col_int_key) (rows=7) -> Table scan on t4 (rows=6) -> Hash - -> Index scan on t1 using col_int_key (rows=7) + -> Covering index scan on t1 using col_int_key (rows=7) -> Nested loop inner join (rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.pk) (rows=1) -> Filter: (t3.col_int_key = t2.col_int) (rows=1) diff --git a/mysql-test/r/subquery_sj_loosescan_bka_nobnl.result b/mysql-test/r/subquery_sj_loosescan_bka_nobnl.result index da2dbec4bae..48141a2be18 100644 --- a/mysql-test/r/subquery_sj_loosescan_bka_nobnl.result +++ b/mysql-test/r/subquery_sj_loosescan_bka_nobnl.result @@ -13085,7 +13085,7 @@ EXPLAIN -> Nested loop inner join (rows=7) -> Filter: (t3.col_int is null) (rows=7) -> Nested loop left join (rows=7) - -> Index scan on t1 using col_int_key (rows=7) + -> Covering index scan on t1 using col_int_key (rows=7) -> Nested loop inner join (rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.pk) (rows=1) -> Index lookup on t3 using col_int_key (col_int_key=t2.col_int) (rows=1) diff --git a/mysql-test/r/subquery_sj_mat.result b/mysql-test/r/subquery_sj_mat.result index b6bd0ce22b2..fb7e8dbb8f8 100644 --- a/mysql-test/r/subquery_sj_mat.result +++ b/mysql-test/r/subquery_sj_mat.result @@ -13486,7 +13486,7 @@ EXPLAIN -> Filter: (t1.col_int_key is not null) (rows=7) -> Filter: (t3.col_int is null) (rows=7) -> Nested loop left join (rows=7) - -> Index scan on t1 using col_int_key (rows=7) + -> Covering index scan on t1 using col_int_key (rows=7) -> Nested loop inner join (rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.pk) (rows=1) -> Filter: (t3.col_int_key = t2.col_int) (rows=1) diff --git a/mysql-test/r/subquery_sj_mat_bka.result b/mysql-test/r/subquery_sj_mat_bka.result index a088f33597e..22142cc5f4b 100644 --- a/mysql-test/r/subquery_sj_mat_bka.result +++ b/mysql-test/r/subquery_sj_mat_bka.result @@ -13487,7 +13487,7 @@ EXPLAIN -> Filter: (t1.col_int_key is not null) (rows=7) -> Filter: (t3.col_int is null) (rows=7) -> Nested loop left join (rows=7) - -> Index scan on t1 using col_int_key (rows=7) + -> Covering index scan on t1 using col_int_key (rows=7) -> Nested loop inner join (rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.pk) (rows=1) -> Filter: (t3.col_int_key = t2.col_int) (rows=1) diff --git a/mysql-test/r/subquery_sj_mat_bka_nobnl.result b/mysql-test/r/subquery_sj_mat_bka_nobnl.result index 7378907ce8a..47adb9adb60 100644 --- a/mysql-test/r/subquery_sj_mat_bka_nobnl.result +++ b/mysql-test/r/subquery_sj_mat_bka_nobnl.result @@ -13480,7 +13480,7 @@ EXPLAIN -> Filter: (t1.col_int_key is not null) (rows=7) -> Filter: (t3.col_int is null) (rows=7) -> Nested loop left join (rows=7) - -> Index scan on t1 using col_int_key (rows=7) + -> Covering index scan on t1 using col_int_key (rows=7) -> Nested loop inner join (rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.pk) (rows=1) -> Index lookup on t3 using col_int_key (col_int_key=t2.col_int) (rows=1) diff --git a/mysql-test/r/subquery_sj_mat_nosj.result b/mysql-test/r/subquery_sj_mat_nosj.result index a62a87c3207..93b8449fb67 100644 --- a/mysql-test/r/subquery_sj_mat_nosj.result +++ b/mysql-test/r/subquery_sj_mat_nosj.result @@ -13149,7 +13149,7 @@ EXPLAIN -> Materialize with deduplication (rows=7) -> Filter: (t3.col_int is null) (rows=7) -> Nested loop left join (rows=7) - -> Index scan on t1 using col_int_key (rows=7) + -> Covering index scan on t1 using col_int_key (rows=7) -> Nested loop inner join (rows=1) -> Single-row index lookup on t2 using PRIMARY (pk=t1.pk) (rows=1) -> Filter: (t3.col_int_key = t2.col_int) (rows=1) diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index ea2a605f5d0..7d6825299d5 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -2069,7 +2069,7 @@ EXPLAIN -> Append (cost=0.45 rows=2) -> Stream results (cost=0.45 rows=1) -> Aggregate: sum(t2.a) (cost=0.45 rows=1) - -> Index scan on t2 using PRIMARY (cost=0.35 rows=1) + -> Covering index scan on t2 using PRIMARY (cost=0.35 rows=1) -> Stream results (cost=0..0 rows=1) -> Zero input rows (No matching min/max row), aggregated into one output row (cost=0..0 rows=1) diff --git a/mysql-test/r/window_functions_interesting_orders.result b/mysql-test/r/window_functions_interesting_orders.result index 1f784256ffd..c0a36b0c0ad 100644 --- a/mysql-test/r/window_functions_interesting_orders.result +++ b/mysql-test/r/window_functions_interesting_orders.result @@ -103,7 +103,7 @@ EXPLAIN -> Window aggregate with buffering: sum(t1.b) OVER (ORDER BY t1.b ) -> Window aggregate with buffering: sum(t1.a) OVER (ORDER BY t1.a ) -> Nested loop inner join - -> Index scan on t1 using idx + -> Covering index scan on t1 using idx -> Filter: (t1.a = t2.b) -> Table scan on t2 @@ -130,6 +130,6 @@ EXPLAIN -> Nested loop inner join -> Index scan on t1 using PRIMARY -> Filter: (t1.x = t2.pk) - -> Index scan on t2 using PRIMARY + -> Covering index scan on t2 using PRIMARY DROP TABLE t1, t2; diff --git a/sql/join_optimizer/explain_access_path.cc b/sql/join_optimizer/explain_access_path.cc index 69c1b3e78e5..852d909c7b6 100644 --- a/sql/join_optimizer/explain_access_path.cc +++ b/sql/join_optimizer/explain_access_path.cc @@ -128,13 +128,17 @@ inline static double GetJSONDouble(const Json_object *obj, const char *key) { */ static bool SetIndexInfoInObject( string *str, const char *json_index_access_type, const char *prefix, - TABLE *table, const KEY *key, const char *index_access_type, + TABLE *table, int key_no, const char *index_access_type, const string lookup_condition, const string *ranges_text, std::unique_ptr range_arr, bool reverse, Item *pushed_idx_cond, Json_object *obj) { + const KEY *key = &table->key_info[key_no]; string idx_cond_str = pushed_idx_cond ? ItemToString(pushed_idx_cond) : ""; + bool is_covering_index = table->key_read || + (!table->no_keyread && + table->covering_keys.is_set(key_no)); string covering_index = - string(table->key_read ? "Covering index " : "Index "); + string(is_covering_index ? "Covering index " : "Index "); bool error = false; if (prefix) covering_index[0] = tolower(covering_index[0]); @@ -540,7 +544,6 @@ static bool ExplainIndexSkipScanAccessPath(Json_object *obj, JOIN *join [[maybe_unused]], string *description) { TABLE *table = path->index_skip_scan().table; - KEY *key_info = table->key_info + path->index_skip_scan().index; string ranges; IndexSkipScanParameters *param = path->index_skip_scan().param; @@ -601,7 +604,8 @@ static bool ExplainIndexSkipScanAccessPath(Json_object *obj, // NOTE: Currently, index skip scan is always covering, but there's no // good reason why we cannot fix this limitation in the future. return SetIndexInfoInObject( - description, "index_skip_scan", nullptr, table, key_info, "skip scan", + description, "index_skip_scan", nullptr, table, + path->index_skip_scan().index, "skip scan", /*lookup condition*/ "", &ranges, std::move(range_arr), /*reverse*/ false, /*push_condition*/ nullptr, obj); } @@ -640,7 +644,8 @@ static bool ExplainGroupIndexSkipScanAccessPath(Json_object *obj, // NOTE: Currently, group index skip scan is always covering, but there's no // good reason why we cannot fix this limitation in the future. error |= SetIndexInfoInObject( - description, "group_index_skip_scan", nullptr, table, key_info, + description, "group_index_skip_scan", nullptr, table, + path->group_index_skip_scan().index, (param->min_max_arg_part ? "skip scan for grouping" : "skip scan for deduplication"), /*lookup condition*/ "", (!ranges.empty() ? &ranges : nullptr), @@ -968,9 +973,8 @@ static std::unique_ptr SetObjectMembers( TABLE *table = path->index_scan().table; assert(table->file->pushed_idx_cond == nullptr); - const KEY *key = &table->key_info[path->index_scan().idx]; error |= SetIndexInfoInObject(&description, "index_scan", nullptr, table, - key, "scan", + path->index_scan().idx, "scan", /*lookup condition*/ "", /*range*/ nullptr, nullptr, path->index_scan().reverse, /*push_condition*/ nullptr, obj); @@ -981,7 +985,8 @@ static std::unique_ptr SetObjectMembers( TABLE *table = path->ref().table; const KEY *key = &table->key_info[path->ref().ref->key]; error |= SetIndexInfoInObject( - &description, "index_lookup", nullptr, table, key, "lookup", + &description, "index_lookup", nullptr, table, path->ref().ref->key, + "lookup", RefToString(*path->ref().ref, key, /*include_nulls=*/false), /*ranges=*/nullptr, nullptr, path->ref().reverse, table->file->pushed_idx_cond, obj); @@ -992,7 +997,8 @@ static std::unique_ptr SetObjectMembers( TABLE *table = path->ref_or_null().table; const KEY *key = &table->key_info[path->ref_or_null().ref->key]; error |= SetIndexInfoInObject( - &description, "index_lookup", nullptr, table, key, "lookup", + &description, "index_lookup", nullptr, table, + path->ref_or_null().ref->key, "lookup", RefToString(*path->ref_or_null().ref, key, /*include_nulls=*/true), /*ranges=*/nullptr, nullptr, false, table->file->pushed_idx_cond, obj); @@ -1003,7 +1009,8 @@ static std::unique_ptr SetObjectMembers( TABLE *table = path->eq_ref().table; const KEY *key = &table->key_info[path->eq_ref().ref->key]; error |= SetIndexInfoInObject( - &description, "index_lookup", "Single-row", table, key, "lookup", + &description, "index_lookup", "Single-row", table, + path->eq_ref().ref->key, "lookup", RefToString(*path->eq_ref().ref, key, /*include_nulls=*/false), /*ranges=*/nullptr, nullptr, false, table->file->pushed_idx_cond, obj); @@ -1017,7 +1024,7 @@ static std::unique_ptr SetObjectMembers( error |= SetIndexInfoInObject( &description, "pushed_join_ref", path->pushed_join_ref().is_unique ? "Single-row" : nullptr, table, - key, "lookup", + path->pushed_join_ref().ref->key, "lookup", RefToString(*path->pushed_join_ref().ref, key, /*include_nulls=*/false), /*ranges=*/nullptr, nullptr, @@ -1029,7 +1036,8 @@ static std::unique_ptr SetObjectMembers( assert(table->file->pushed_idx_cond == nullptr); const KEY *key = &table->key_info[path->full_text_search().ref->key]; error |= SetIndexInfoInObject( - &description, "full_text_search", "Full-text", table, key, "search", + &description, "full_text_search", "Full-text", table, + path->full_text_search().ref->key, "search", RefToString(*path->full_text_search().ref, key, /*include_nulls=*/false), /*ranges=*/nullptr, nullptr, @@ -1050,7 +1058,8 @@ static std::unique_ptr SetObjectMembers( TABLE *table = path->mrr().table; const KEY *key = &table->key_info[path->mrr().ref->key]; error |= SetIndexInfoInObject( - &description, "multi_range_read", "Multi-range", table, key, "lookup", + &description, "multi_range_read", "Multi-range", table, + path->mrr().ref->key, "lookup", RefToString(*path->mrr().ref, key, /*include_nulls=*/false), /*ranges=*/nullptr, nullptr, false, table->file->pushed_idx_cond, obj); @@ -1078,7 +1087,7 @@ static std::unique_ptr SetObjectMembers( error |= PrintRanges(param.ranges, param.num_ranges, key_info->key_part, /*single_part_only=*/false, range_arr, &ranges); error |= SetIndexInfoInObject( - &description, "index_range_scan", nullptr, table, key_info, + &description, "index_range_scan", nullptr, table, param.index, "range scan", /*lookup condition*/ "", &ranges, std::move(range_arr), path->index_range_scan().reverse, table->file->pushed_idx_cond, obj); -- 2.19.1