Details
-
Bug
-
Status: In Review (View Workflow)
-
Blocker
-
Resolution: Unresolved
-
12.3
-
None
-
Q1/2026 Server Development
Description
|
|
create table t1 ( |
a int, |
b int, |
index(a) |
);
|
|
|
insert into t1 select seq, seq from seq_1_to_10000; |
|
|
analyze format=json
|
select * from t1 |
where a > 9900 and (a+1 > 9901) |
order by a desc; |
gives this output
{
|
"query_optimization": { |
"r_total_time_ms": 0.674235924 |
},
|
"query_block": { |
"select_id": 1, |
"cost": 0.026931824, |
"r_loops": 1, |
"r_total_time_ms": 11286.65038, |
"nested_loop": [ |
{
|
"table": { |
"table_name": "t1", |
"access_type": "range", |
"possible_keys": ["a"], |
"key": "a", |
"key_length": "5", |
"used_key_parts": ["a"], |
"loops": 1, |
"r_loops": 1, |
"rows": 10, |
"r_index_rows": 10000, |
"r_rows": 0, |
"cost": 0.02056344, |
"r_table_time_ms": 27.22319728, |
"r_other_time_ms": 0.028516076, |
"r_engine_stats": { |
"pages_accessed": 14 |
},
|
"filtered": 100, |
"r_total_filtered": 0, |
"index_condition": "t1.a + 1 > 999991 and t1.a > 9990", |
"r_icp_filtered": 0, |
"r_filtered": 100 |
}
|
}
|
]
|
}
|
}
|
Note the
"r_index_rows": 10000,
|
This happened because set_end_range() call was not made, and index_last() walked off the left endoint of the t1.a > 9990 range and scanned the whole table.
Attachments
Issue Links
- relates to
-
MDEV-38921 Wrong result for range w/o min endpoint, ORDER BY DESC and ICP
-
- In Review
-