Port v5.1 Prefix Index Queries Optimization
Feature: Prefix Index Queries Optimization
Optimize prefix index queries to skip cluster index lookup when possible.
Currently InnoDB will always fetch the clustered index (primary key
index) for all prefix columns in an index, even when the value of a
particular record is smaller than the prefix length. This change
optimizes that case to use the record from the secondary index and avoid
the extra lookup.
Also adds two status vars that track how effective this is:
Times secondary index lookup triggered cluster lookup.
Times prefix optimization avoided triggering cluster lookup.