Dan Nelson wrote:
Yes, with only 24 values, MySQL will probably never use that index forAccording to the EXPLAIN output, it does; but its still horrifically slow.
paring down records in a regular SELECT. But for your count() case it
should.
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
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php