indexing - How does MySQL use ORDER BY when referencing an indexed prefix on VARCHAR? -


i'm curious how handled. have varchar(255) column named title has first 10 characters indexed.

if create mysql query orders title, take advantage of index solely, or ignore it, or have issue command use index?

for example let's have 2 title items named:

this same thing same thing different 

the first 10 chars same, how mysql handle that? use prefix index first 10 chars , row row index afterwards?

well, it's said that:

the index can used if order not match index exactly, long of unused portions of index , order columns constants in clause.

but suggest checking query explain, see path optimizer choose.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -