ha_innobase.cc:

Assume selectivity of any key prefix is better than 1 / 100, regardless of what the estimator returns; this balances the pessimistic assumption of the optimizer thatany secondary key access to the full row incurs a page read from disk


sql/ha_innobase.cc:
  Assume selectivity of any key prefix is better than 1 / 100, regardless of what the estimator returns; this balances the pessimistic assumption of the optimizer thatany secondary key access to the full row incurs a page read from disk
This commit is contained in:
unknown 2002-01-30 14:10:26 +02:00
parent 94f7b7f33f
commit dec0182c40

View file

@ -3130,6 +3130,22 @@ ha_innobase::info(
rec_per_key = 1;
}
/* Since the MySQL optimizer is often too
pessimistic in the assumption that a table
does not fit in the buffer pool, we
increase the attractiveness of indexes
by assuming the selectivity of any prefix
of an index is 1 / 100 or better.
(Actually, we should look at the table
size, and if the table is smaller than
the buffer pool, we should uniformly
increase the attractiveness of indexes,
regardless of the estimated selectivity.) */
if (rec_per_key > records / 100) {
rec_per_key = records / 100;
}
table->key_info[i].rec_per_key[j]
= rec_per_key;
}