title: MySQLoptimization in combining 3 tables and search
body: <p>Can anyone tell me whats wrong with this MySQL query ?</p>
  
  <pre><code>select distinct(a.productId)
    from product a
    left join product_keyword b
      on b.productId = a.productId
    left join keywords c
      on c.keywordId = b.keywordId
    where a.productName LIKE '%truck%' OR c.value LIKE '%truck%'
    limit 100;
  </code></pre>
  
  <p>Actually I need to join 3 tables (<code>product</code>, <code>product_keyword</code> and <code>keywords</code>) and search based on user input. One product can be multiple keywords and I store it (<code>keywordId</code> from <code>table</code> keywords in <code>product_keyword</code>).</p>
  
  <p>Can anyone help me please?</p>