MySQL Forums
Forum List  »  Optimizer & Parser

Re: Query Optimization
Posted by: Peter Brawley
Date: March 21, 2006 11:24AM

The optimiser expects to have to read 57,564 rows. That shouldn't take anything close to 90 seconds on reasonable hardware. You might try running ANALYZE TABLE and OPTIMIZE TABLE. If that doesn't help, conceivably an index named 'xy' on x and y might speed things up (so the query would say FROM tbl FORCE index(xy) ..., but that's a longshot. I would try running SELECTs on the two BETWEEN conditions separately, eahc using its own index. If those are substantially faster, you might want to look at using temp tables.

If all that fails, run ...

SHOW STATUS like 'key%';

and tinker with cache & mem settings (another topic) discussed in the manual's optimisation section.


Options: ReplyQuote

Written By
March 21, 2006 06:10AM
March 21, 2006 08:24AM
March 21, 2006 09:19AM
Re: Query Optimization
March 21, 2006 11:24AM

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.