Zipbang
asked on
Slow simple MySQL query (date range)
This is a very simple table with 6 columns. Currently the table has more than 4 million records. This is the query:
SELECT * FROM chamber_ghst
WHERE chamberid='Ambient' and
actiondate BETWEEN '2013/06/12 12:06:00' and '2013/06/13 12:06:00'
ORDER BY actiondate ASC
This query results in 288 records. It takes about 16 seconds. I just don't see why or understand how I can optimize this.
SELECT * FROM chamber_ghst
WHERE chamberid='Ambient' and
actiondate BETWEEN '2013/06/12 12:06:00' and '2013/06/13 12:06:00'
ORDER BY actiondate ASC
This query results in 288 records. It takes about 16 seconds. I just don't see why or understand how I can optimize this.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
But that said, there are some really good articles here at EE about MySQL performance. Example here:
https://www.experts-exchange.com/Database/MySQL/A_1250-3-Ways-to-Speed-Up-MySQL.html