title: Why my mysql doesn't use index?
body: <p>I'm tuning my query for mysql.
  the schema has index of user_id (following..)
  but the index is not used. why?</p>
  
  <p>Env:
      MySQL4.0.27,MyISAM</p>
  
  <p>SQL is the following :</p>
  
  <pre><code>SELECT type,SUM(value_a) A, SUM(value_b) B, SUM(value_c) C
  FROM  big_record_table
  WHERE  user_id='&lt;user_id&gt;'
  GROUP BY type
  </code></pre>
  
  <p>Explain:</p>
  
  <pre><code>|table |type |possible_keys |key |key_len |ref |rows |Extra|
  
  |big_record_table| ALL| user_id_key|||| 1059756 |Using where; Using temporary; Using filesort|
  </code></pre>
  
  <p>could you describe detail?</p>
  
  <p>scheme is following:</p>
  
  <pre><code>CREATE TABLE `big_record_table` (
   `user_id` int(11) NOT NULL default '0',
   `type` enum('type_a','type_b','type_c') NOT NULL default 'type_a',
   `value_a` bigint(20) NOT NULL default '0',
   `value_b` bigint(20) default NULL,
   `value_c` bigint(20) NOT NULL default '0',
   KEY `user_id_key` (`user_id`)
  ) TYPE=MyISAM
  </code></pre>