Your developers have created table to store some of their program’s data. After examining the
slow Query Log, you see that they are using the LIKE operator and SUBSTER () functions against
a VARCHAR (10000) column quite often.
An example of the start of one row of data:
‘GREEN01020495888331993-12-10/2…’
What should you do to improve the overall performance?
A.
Convert the column to TEXT and add a fulltext index to the table.
B.
Create multiple prefix indexes of differing lengths.
C.
Convert their column to BINARY.
D.
Redesign the table so that the most commonly searched for string patterns are in their own
columns.
Explanation:
A.
http://dev.mysql.com/doc/refman/5.6/en/innodb-fulltext-index.html
Fulltext won’t help here with substr() functions and ‘like’ operator.
The only way is redesign the table so searchable patterns are in their own columns and can be indexed.
D.
A
D
A: false. maintaining a FTI is useful if I don’t know the placement of the data.
B: false. A prefix index starts at the beginning of the column. We need offset too
C: false. the column is actually a string
d: true. the column can be clearly split in different fields, each with its own index.