summaryrefslogtreecommitdiff
path: root/mysql-test/main/subselect_innodb.result
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2023-01-26 11:38:31 +0200
committerMonty <monty@mariadb.org>2023-02-10 12:59:36 +0200
commit01c82173dd8b6ea627dec949dbc57dfcc94a656d (patch)
treee46baaa2137bfaf0f2972880c07eed45af08dd06 /mysql-test/main/subselect_innodb.result
parent87507bbb4f2f8e3cc0ccd3a2b8e45cf218963d7d (diff)
downloadmariadb-git-01c82173dd8b6ea627dec949dbc57dfcc94a656d.tar.gz
Removed /2 of InnoDB ref_per_key[] estimates
The original code was there to favor index search over table scan. This is not needed anymore as the cost calculations for table scans and index lookups are now more exact.
Diffstat (limited to 'mysql-test/main/subselect_innodb.result')
-rw-r--r--mysql-test/main/subselect_innodb.result24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/main/subselect_innodb.result b/mysql-test/main/subselect_innodb.result
index b74ad66366f..2ce0096831b 100644
--- a/mysql-test/main/subselect_innodb.result
+++ b/mysql-test/main/subselect_innodb.result
@@ -560,6 +560,7 @@ id select_type table type possible_keys key key_len ref rows Extra
#
# MDEV-6081: ORDER BY+ref(const): selectivity is very incorrect (MySQL Bug#14338686)
#
+insert into t2 select seq,seq,seq from seq_10000_to_11000;
alter table t2 add key2 int;
update t2 set key2=key1;
alter table t2 add key(key2);
@@ -580,6 +581,29 @@ t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL #
2 DEPENDENT SUBQUERY t2 ref key1 key1 5 test.t1.a # Using where; Using filesort
+select
+(SELECT
+concat(id, '-', key1, '-', col1)
+FROM t2
+WHERE t2.key1 = t1.a
+ORDER BY t2.key2 ASC LIMIT 1)
+from
+t1;
+(SELECT
+concat(id, '-', key1, '-', col1)
+FROM t2
+WHERE t2.key1 = t1.a
+ORDER BY t2.key2 ASC LIMIT 1)
+100-0-123456
+101-1-123456
+102-2-123456
+103-3-123456
+104-4-123456
+105-5-123456
+106-6-123456
+107-7-123456
+108-8-123456
+109-9-123456
drop table t1,t2;
#
# MDEV-12931: semi-join in ON expression of STRAIGHT_JOIN