List:General Discussion« Previous MessageNext Message »
From:Michael T. Babcock Date:November 7 2002 8:59pm
Subject:Re: Key/table cache size?
View as plain text  
Dan Nelson wrote:

>Yes, with only 24 values, MySQL will probably never use that index for
>paring down records in a regular SELECT.  But for your count() case it
>should.
>  
>

According to the EXPLAIN output, it does; but its still horrifically slow.

mysql> explain SELECT count(DISTINCT(sig_class_id)) FROM acid_event;
+------------+-------+---------------+--------------+---------+------+--------+-------------+
| table      | type  | possible_keys | key          | key_len | ref  | 
rows   | Extra       |
+------------+-------+---------------+--------------+---------+------+--------+-------------+
| acid_event | index | NULL          | sig_class_id |       5 | NULL | 
377222 | Using index |
+------------+-------+---------------+--------------+---------+------+--------+-------------+

Mind you, it doesn't pare it down much ...

-- 
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


Thread
Key/table cache size?Michael T. Babcock7 Nov
  • Re: Key/table cache size?Dan Nelson7 Nov
  • Re: Key/table cache size?Michael T. Babcock7 Nov
  • Re: Key/table cache size?Jeremy Zawodny7 Nov
RE: Key/table cache size?Peter Grigor7 Nov
  • Re: Key/table cache size?Michael T. Babcock7 Nov