title: How to interpret the output of MySQL EXPLAIN?
body: <p>I want to select the content of the column <code>text</code> from <code>entrytable</code>.</p>
  
  <pre><code>EXPLAIN SELECT text
  FROM entrytable
  WHERE user = 'username' &amp;&amp;
  `status` = '1' &amp;&amp; (
      `status_spam_user` = 'no_spam'
      || (
          `status_spam_user` = 'neutral' &amp;&amp;
          `status_spam_system` = 'neutral'
      )
  )
  ORDER BY datum DESC
  LIMIT 6430 , 10
  </code></pre>
  
  <p>The table has three indices: </p>
  
  <ul>
  <li>index_user (user)</li>
  <li>index_datum (datum)</li>
  <li>index_status_mit_spam (status, status_spam_user, status_spam_system)</li>
  </ul>
  
  <p>The EXPLAIN result is:</p>
  
  <pre><code>id  select_type     table       type    possible_keys                       key         key_len     ref     rows    Extra
  1   SIMPLE          entrytable  ref     index_user,index_status_mit_spam    index_user  32          const   7800    Using where; Using filesort
  </code></pre>
  
  <ul>
  <li>Is <code>possible_keys</code> the indices MySQL might want to use and <code>keys</code> the indices MySQL actually uses?</li>
  <li>Why is the index <code>index_status_mit_spam</code> not used? In the query, the colums have the same order as in the index,...</li>
  <li>Why is the index <code>index_datum</code> not used for the <code>ORDER BY</code>?</li>
  <li>How can I optimize my table-indices or the query? (The query above needs up to 3 seconds having about a million entries in the table)</li>
  </ul>