Commit b908f410 authored by heikki@donna.mysql.fi's avatar heikki@donna.mysql.fi

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
parent 6202aa7c
Branches unavailable
Tags unavailable
No related merge requests found
...@@ -3130,6 +3130,22 @@ ha_innobase::info( ...@@ -3130,6 +3130,22 @@ ha_innobase::info(
rec_per_key = 1; 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] table->key_info[i].rec_per_key[j]
= rec_per_key; = rec_per_key;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment