Optimizer Chooses Different Indexes on SELECT Using DISTINCT, ORDER BY and LIMIT Depending on LIMIT threshold (Doc ID 2060319.1)

Last updated on NOVEMBER 25, 2015

Applies to:

MySQL Server - Version 4.0 and later
Information in this document applies to any platform.

Symptoms

The following query execution time raises when limit crosses a certain threshold:

SELECT DISTINCT T1.a, T1.b, T1.c from T1 ORDER BY T1.c LIMIT offset, count

 

Additional information:

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms