Categories
WHERE str LIKE 'a%' SORT BY LENGTH(str) LIMIT N?
Is it possible to optimize the selection WHERE str LIKE 'a%' ORDER BY LENGTH(str) LIMIT N? Or will it always be FULL SCAN?
Answer the question
In order to leave comments, you need to log in
like 'const%' can use an index by field.
if this same limit limits the selection severely enough, why not do select… from (select… from… order by length(str) limit N) where str line '%a'
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question