summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-12-17 19:59:59 +0200
committermonty@hundin.mysql.fi <>2001-12-17 19:59:59 +0200
commit54d10622c58a5fcf2647792f7323f123f8478e60 (patch)
tree3bfe9a78d418da39ee6b952cccc6e381ac35d20d /sql
parentf049543416fd9d47d4a441c3b8e998b3d8d52812 (diff)
parenta6fedfc3d44bf8eb4d9d16244c750d829e0141c1 (diff)
downloadmariadb-git-54d10622c58a5fcf2647792f7323f123f8478e60.tar.gz
Merge work:/home/bk/mysql into hundin.mysql.fi:/my/bk/mysql
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innobase.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc
index 093d4e91c30..9bd25c67009 100644
--- a/sql/ha_innobase.cc
+++ b/sql/ha_innobase.cc
@@ -3035,15 +3035,18 @@ ha_innobase::estimate_number_of_rows(void)
DBUG_ENTER("info");
- dict_update_statistics(prebuilt->table);
-
index = dict_table_get_first_index_noninline(prebuilt->table);
data_file_length = ((ulonglong) index->stat_n_leaf_pages)
* UNIV_PAGE_SIZE;
- /* Calculate a minimum length for a clustered index record */
- estimate = data_file_length / dict_index_calc_min_rec_len(index);
+ /* Calculate a minimum length for a clustered index record and from
+ that an upper bound for the number of rows. Since we only calculate
+ new statistics in row0mysql.c when a tablehas grown
+ by a threshold factor, we must add a safety factor 2 in front
+ of the formula below. */
+
+ estimate = 2 * data_file_length / dict_index_calc_min_rec_len(index);
if (prebuilt->trx) {
prebuilt->trx->op_info = "";