MySQL Forums
Forum List  »  Optimizer & Parser

Re: Query needs to be optimized
Posted by: Rick James
Date: June 30, 2010 08:50AM

To assist in analyzing slow SELECTs, please provide
* SHOW CREATE TABLE tbl\G -- engine, indexes
* SHOW TABLE STATUS LIKE 'tbl'\G -- sizes
* EXPLAIN SELECT ...\G -- clues of inefficiencies
* SHOW VARIABLES LIKE '%buffer%'; -- cache size
and surround them with [ code ] and [ / code ]

Do you really need LEFT JOIN, not just JOIN?

AND p.timestamp >='2010-02-02' AND p.timestamp<='2010-06-02' -- Is that a TIMESTAMP or a DATE? If a TIMESTAMP, do you really want midnight at both ends?

Options: ReplyQuote

Written By
June 29, 2010 03:39AM
Re: Query needs to be optimized
June 30, 2010 08:50AM
July 01, 2010 09:43PM

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.