diff options
author | unknown <serg@serg.mylan> | 2004-07-20 00:53:24 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2004-07-20 00:53:24 +0200 |
commit | eee5f15b92f71c74ce315932770a603e4deef477 (patch) | |
tree | b39cfbb54d66b05cd075839aa58dc3215c8d4146 /innobase/btr | |
parent | d57d78ac10980e28344f285bdbc986fa3ee3496e (diff) | |
parent | b940ae1012b00e74e2155c4e35ca7872bed278e3 (diff) | |
download | mariadb-git-eee5f15b92f71c74ce315932770a603e4deef477.tar.gz |
manual merged (blame me!)
Build-tools/Do-compile:
Auto merged
Docs/Makefile.am:
Auto merged
innobase/btr/btr0cur.c:
Auto merged
innobase/include/lock0lock.h:
Auto merged
innobase/include/row0mysql.h:
Auto merged
innobase/include/srv0srv.h:
Auto merged
innobase/include/sync0arr.h:
Auto merged
innobase/include/trx0trx.h:
Auto merged
innobase/lock/lock0lock.c:
Auto merged
innobase/srv/srv0srv.c:
Auto merged
innobase/srv/srv0start.c:
Auto merged
innobase/sync/sync0arr.c:
Auto merged
innobase/trx/trx0trx.c:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
mysql-test/r/innodb.result:
to be fixed after the merge
Diffstat (limited to 'innobase/btr')
-rw-r--r-- | innobase/btr/btr0cur.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c index 2e9194ff30f..be201da4510 100644 --- a/innobase/btr/btr0cur.c +++ b/innobase/btr/btr0cur.c @@ -2717,8 +2717,11 @@ btr_estimate_number_of_different_key_vals( rec = page_rec_get_next(rec); } + if (n_cols == dict_index_get_n_unique_in_tree(index)) { - /* We add one because we know that the first record + + /* If there is more than one leaf page in the tree, + we add one because we know that the first record on the page certainly had a different prefix than the last record on the previous index page in the alphabetical order. Before this fix, if there was @@ -2726,7 +2729,11 @@ btr_estimate_number_of_different_key_vals( algorithm grossly underestimated the number of rows in the table. */ - n_diff[n_cols]++; + if (btr_page_get_prev(page, &mtr) != FIL_NULL + || btr_page_get_next(page, &mtr) != FIL_NULL) { + + n_diff[n_cols]++; + } } total_external_size += |