1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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.
This commit is contained in:
Monty
2023-01-26 11:38:31 +02:00
parent 87507bbb4f
commit 01c82173dd
13 changed files with 64 additions and 33 deletions

View File

@ -208,8 +208,8 @@ t2
where t1.id = dt.id and t1.itemid = dt.itemid and t2.id=t1.itemid;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 1
1 PRIMARY t1 ref idx idx 4 test.t2.id 1
1 PRIMARY <derived2> ref key0 key0 9 test.t2.id,test.t1.id 1
1 PRIMARY <derived2> ref key1 key1 4 test.t2.id 1
1 PRIMARY t1 ref idx idx 4 test.t2.id 3 Using where
2 DERIVED t3 ref idx1,idx2 idx1 4 const 5 Using where; Using index
select t1.id, t1.itemid, dt.id, t2.id
from t1,
@ -227,8 +227,8 @@ t2
where t1.id = dt.id and t1.itemid = dt.itemid and t2.id=t1.itemid;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 1
1 PRIMARY t1 ref idx idx 4 test.t2.id 1
1 PRIMARY <derived2> ref key0 key0 9 test.t2.id,test.t1.id 1
1 PRIMARY <derived2> ref key1 key1 4 test.t2.id 1
1 PRIMARY t1 ref idx idx 4 test.t2.id 3 Using where
2 DERIVED t3 ref idx1 idx1 4 const 5 Using where; Using index
select t1.id, t1.itemid, dt.id, t2.id
from t1,