Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
10.4(EOL)
Description
create table t2 (kp1 int, kp2 int, key(kp1, kp2)); |
insert into t2 values (1,1),(1,5),(5,1),(5,5); |
set optimizer_trace=1; |
select * from t2 force index(kp1) where (kp1=2 and kp2 >=4); |
select * from information_schema.optimizer_trace;
|
shows
"range_scan_alternatives": [
|
{
|
"index": "kp1",
|
"ranges": ["(2,3) <= (kp1,kp2)"],
|
"rowid_ordered": false,
|
"using_mrr": false,
|
"index_only": false,
|
"rows": 10,
|
"cost": 58.75,
|
"chosen": true
|
}
|
],
|
This is clearly incorrect as kp1=2 allows the range to have an upper bound too.