mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
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:
parent
94f7b7f33f
commit
dec0182c40
1 changed files with 16 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue