Re: Slow Query Time for Many Records from Large Table
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!
Subject
Views
Written By
Posted
2756
November 08, 2005 05:04AM
1477
November 08, 2005 08:08AM
Re: Slow Query Time for Many Records from Large Table
1462
November 08, 2005 02:21PM
1483
November 08, 2005 02:40PM
1476
November 08, 2005 03:34PM
1573
November 08, 2005 04:10PM
1554
November 08, 2005 05:09PM
1667
November 08, 2005 09:51PM
1430
November 11, 2005 05:54AM
1459
November 08, 2005 08:05PM
1437
November 11, 2005 06:10AM
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.