<snip>

> Heikki> Well, mystery solved :). Except that why MySQL uses hours to
> Heikki> sieve away the extraneous rows in the first query.
>
> To be able to answer the question why:
>
> SELECT COUNT(*) FROM table1 WHERE col1=0 and col2=0
>
> Is slow, I would need to get an EXPLAIN for this query.

mysql> explain select count(*) from messages where clean=0 and
parentmsgid=0;

+----------+-------+---------------+-------------+---------+------+---------
+-------------------------+
| table    | type  | possible_keys | key         | key_len | ref  | rows
| Extra                   |
+----------+-------+---------------+-------------+---------+------+---------
+-------------------------+
| messages | index | parentmsgid   | parentmsgid |       5 | NULL | 7207120
| where used; Using index |
+----------+-------+---------------+-------------+---------+------+---------
+-------------------------+

It appears that it is using the index, but it takes a very long time to
complete..

Thanks,
ryan



---------------------------------------------------------------------
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

Reply via email to