Bug #62676 I don't understand the MRR docs
Submitted: 11 Oct 2011 1:23 Modified: 27 Jun 2018 13:46
Reporter: Mark Callaghan Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6.3 OS:Any
Assigned to: Paul Dubois CPU Architecture:Any
Tags: Optimizer

[11 Oct 2011 1:23] Mark Callaghan
I don't understand http://dev.mysql.com/doc/refman/5.6/en/mrr-optimization.html

First, the docs state that MRR can help for queries that scan a secondary index and then must fetch the row by row ID (I think it would be more clear to state "by row ID or PK"). It then states that as the secondary index scan is done the row IDs can be incrementally sorted to reduce disk read overhead when they must be fetched.

But the example that follows is very different than what was described. First it requires that the index column have an integer type so "col between 1000 and 2000" can be converted to point lookups. As the example is explained, no mention is made of ordering the row ID (or PK) values. Instead the example shows how equality loops can be done on both fields of a composite index even though there isn't an equality predicate on the leading index column.

How to repeat:
read the docs

Suggested fix:
Change the example or the initial description. Mention PKs in addition to row IDs.
[11 Oct 2011 3:52] Valeriy Kravchuk
Thank you for the documentation request.
[27 Jun 2018 13:46] Paul Dubois
Posted by developer:
Removed the not-helpful example.