MySQL Forums
Forum List  »  Performance

Re: Slow Query Time for Many Records from Large Table
Posted by: John Lombardi
Date: November 08, 2005 02:21PM

Thanks, Jay. As a starting point, this query taking the time it does concerns me. The select and the explain are shown below...

mysql> select SQL_NO_CACHE count(*) FROM table WHERE AID = '3';
+----------+
| count(*) |
+----------+
| 40997 |
+----------+
1 row in set (0.06 sec)

mysql> explain select SQL_NO_CACHE count(*) FROM table WHERE AID = '3';
+------------------+------+---------------+------+---------+-------+-------+--------------------------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+------------------+------+---------------+------+---------+-------+-------+--------------------------+
| table | ref | idx1 | idx1 | 2 | const | 47925 | Using where; Using index |
+------------------+------+---------------+------+---------+-------+-------+--------------------------+
1 row in set (0.01 sec)

This was taken from a test server where there are no INSERTs or UPDATEs occuring. Thanks!

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Slow Query Time for Many Records from Large Table
1330
November 08, 2005 02:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.