Take the 2-minute tour ×

i have an innodb mysql table with a varchar(100) field called 'word'.

i created a btree index on an that field.

if i do a query like select * from table where word = 'non-linear', i get all variations of that word. so results would include (Non-linear, Non-Linear, non-Linear, etc...).

it seems to me that that index doesnt care about the capitalization.

does this mean that the index has 1 record for this word?

if so, is there a way to get a list of all the keys in the index so that i would essentially have a list of unique terms?

share|improve this question
add comment

1 Answer

String comparisons are not case-sensitive for non-binary data types like varchar, char, text. For binary strings (BINARY, VARBINARY, BLOB), comparisons use the numeric values of the bytes in the operands; this means that for alphabetic characters, comparisons will be case sensitive.

More information available at Mysql Docs.

share|improve this answer
Thanks, this was helpful enough to answer my first question regarding case sensitivity. I am still unclear if there is a way to get the actual values out of an index. –  britt Oct 25 '10 at 18:49
The keys in the index are created from the data you build the index on. It isn't like every combination, the keys are the data that is present. In your case if you created an index on varchar column having data ABC, abc and AbC. Then since all these are equal if you are not using binary then the key would be ABC only and this will have the values ABC, abc and AbC. –  Faisal Feroz Oct 26 '10 at 6:23
add comment

Your Answer


