diff options
author | unknown <heikki@hundin.mysql.fi> | 2003-01-28 01:14:06 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2003-01-28 01:14:06 +0200 |
commit | 8d25a3fd942c06bb6c5bdff53b07bfa78fcc6bd6 (patch) | |
tree | 9d17d7aaa2fe5e0905dd52a9a9cab81e689cadf8 /innobase | |
parent | 933e200810a7c95b0008c048b4113224a6daf1d0 (diff) | |
download | mariadb-git-8d25a3fd942c06bb6c5bdff53b07bfa78fcc6bd6.tar.gz |
btr0cur.c:
Backport from 4.0: 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
innobase/btr/btr0cur.c:
Backport from 4.0: 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
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/btr/btr0cur.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c index e1fe5ba8771..420de3c8f77 100644 --- a/innobase/btr/btr0cur.c +++ b/innobase/btr/btr0cur.c @@ -577,11 +577,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; } @@ -594,6 +594,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); |