If I have a column short_title in MySQL table and it is defined as UNIQUE, do I also have to add FULLTEXT for it to be searchable really fast? Or does UNIQUE already guarantee it will be searchable quickly (without full table scan)?
Thanks, Boda Cydo
UNIQUEwill locate the verbatimshort_titleusing the underlying index.If you need a word match (as opposed to verbatim match), use
FULLTEXTindex.Also note that by default the
B-Treeindexes inMyISAMagainst theVARCHARcolumns are subject to key compression. This can slow down the searches for the titles closer to the end of the alphabet:Finally, the
VARCHARkeys tend to be large in size.For the fastest verbatim searches, you should store a
MD5hash of the title in aBINARY(16)column, create aUNIQUEindex over it (disabling the key compression) and search for the hash.