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
2525
November 08, 2005 05:04AM
1372
November 08, 2005 08:08AM
Re: Slow Query Time for Many Records from Large Table
1330
November 08, 2005 02:21PM
1371
November 08, 2005 02:40PM
1371
November 08, 2005 03:34PM
1464
November 08, 2005 04:10PM
1417
November 08, 2005 05:09PM
1548
November 08, 2005 09:51PM
1316
November 11, 2005 05:54AM
1341
November 08, 2005 08:05PM
1322
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.