title: Optimizing MySQL LIKE '%string%' queries in innoDB
body: <p>Having this table:</p>
  
  <pre><code>CREATE TABLE `example` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `keywords` varchar(200) NOT NULL,
  PRIMARY KEY  (`id`)
  ) ENGINE=InnoDB;
  </code></pre>
  
  <p>We would like to optimize the following query:</p>
  
  <pre><code>SELECT id FROM example WHERE keywords LIKE '%whatever%'
  </code></pre>
  
  <p>The table is InnoDB, (so no FULLTEXT for now) which would be the best index to use in order to optimize such query?</p>
  
  <p>We've tried a simple : </p>
  
  <pre><code>ALTER TABLE `example` ADD INDEX `idxSearch` (`keywords`);
  </code></pre>
  
  <p>But an explain query shows that need to scan the <strong>whole table</strong> 
  if our queries where LIKE 'whatever%' instead, this index performs well, but otherwise has no value.</p>
  
  <p>Is there anyway to optimize this for innoDB ?</p>
  
  <p>Thanks!</p>