Improvements to ORDER BY optimization in MariaDB 10.1

You are viewing an old version of this article. View the current version here.

MariaDB 10.1 includes several fixes to ORDER BY optimizer.

The fixes were made as a response to complaints of MariaDB customers, so they fix real-world optimization problems. The fixes are a bit hard to describe (as ORDER BY optimizer is complicated), but here's a short description: ORDER BY optimizer in MariaDB 10.1:

  • Doesn’t make stupid choices when several multi-part keys and potential range accesses are present (MDEV-6402)
  • Always uses “range” and (not full “index” scan) when it switches to an index to satisfy ORDER BY … LIMIT (MDEV-6657)
  • Tries hard to be smart and use cost/number of records estimates from other parts of the optimizer (MDEV-6384, MDEV-465)
  • Takes full advantage of InnoDB’s Extended Keys feature when checking if filesort() can be skipped (MDEV-6796)

See also

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.