title: What's a MySQL index table?
body: <p>I need to speed up a query. Is an index table what I'm looking for? If so, how do I make one? Do I have to update it each insert?</p>
  
  <p>Here are the table schemas:</p>
  
  <pre><code>--table1--   |   --tableA--   |    --table2--
  id           |   id           |    id
  attrib1      |   t1id         |    attrib1
  attrib2      |   t2id         |    attrib2
               |   attrib1      |
  </code></pre>
  
  <p>And the query:</p>
  
  <pre><code>SELECT 
    table1.attrib1, 
    table1.attrib2,
    tableA.attrib1 
  FROM 
    table1,
    tableA
  WHERE 
    table1.id = tableA.t1id
    AND (tableA.t2id = x or ... or tableA.t2id = z)
  GROUP BY 
    table1.id
  </code></pre>