Optimizing MySQL LIKE '%string%' queries in innoDB
问题 Having this table: CREATE TABLE `example` ( `id` int(11) unsigned NOT NULL auto_increment, `keywords` varchar(200) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; We would like to optimize the following query: SELECT id FROM example WHERE keywords LIKE '%whatever%' The table is InnoDB, (so no FULLTEXT for now) which would be the best index to use in order to optimize such query? We've tried a simple : ALTER TABLE `example` ADD INDEX `idxSearch` (`keywords`); But an explain query shows that need