mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
btr0cur.c:
Fix a major bug in InnoDB query estimator for queries of type SELECT ... WHERE col < x and SELECT ... WHERE col > x; MySQL could pick a table scan though the result set was only a few rows in a big table
This commit is contained in:
parent
493e391182
commit
c79a53714d
1 changed files with 8 additions and 4 deletions
|
@ -604,11 +604,11 @@ btr_cur_open_at_index_side(
|
|||
page_cur_set_after_last(page, page_cursor);
|
||||
}
|
||||
|
||||
if (estimate) {
|
||||
btr_cur_add_path_info(cursor, height, root_height);
|
||||
}
|
||||
|
||||
if (height == 0) {
|
||||
if (estimate) {
|
||||
btr_cur_add_path_info(cursor, height,
|
||||
root_height);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -621,6 +621,10 @@ btr_cur_open_at_index_side(
|
|||
page_cur_move_to_prev(page_cursor);
|
||||
}
|
||||
|
||||
if (estimate) {
|
||||
btr_cur_add_path_info(cursor, height, root_height);
|
||||
}
|
||||
|
||||
height--;
|
||||
|
||||
node_ptr = page_cur_get_rec(page_cursor);
|
||||
|
|
Loading…
Reference in a new issue