MariaDB 11.0 and a new optimizer cost model

The 11.0 release rewrites the cost constants, which is a change that improves most plans and changes some of yours.

what changed: the cost of an index lookup relative to a
table scan was tuned against modern storage, where the
old constants assumed spinning disks.

what that means in practice:
  more index use on medium-selectivity predicates
  fewer full scans chosen "because the table is small"

and what to do about it: capture the plans for your top
twenty queries BEFORE upgrading, and diff them after.

A cost model change is the kind of upgrade where nothing in the release notes names your query and one of them gets slower anyway. Capturing plans beforehand turns “the site feels slow” into a diff, and it takes an hour. Two of ours changed and both improved; the one that regressed was on a table with stale statistics, which the upgrade had made more consequential rather than caused.