MySQL Forums
Forum List  »  PHP

Re: How to improve query performance in expression related order by?
Posted by: Rick James
Date: April 27, 2009 12:43AM

To assist in analyzing slow SELECTs, please provide
* SHOW CREATE TABLE tbl\G <-- Engine type? Indexes?
* SHOW TABLE STATUS LIKE 'tbl'\G <-- row size
* EXPLAIN SELECT ...\G <-- what it decided to do
and surround them with [ code ] and [ / code ]

Is the query optimizer smart enough to use INDEX(lat) on expressions like
(lat - 12.34) < 0.1 (lat-12.34) > -0.1
instead of a simple range like
lat BETWEEN 12.34 - 0.1 AND 12.34 + 0.1

Do you have an ID for each row?

Options: ReplyQuote


Subject
Written By
Posted
Re: How to improve query performance in expression related order by?
April 27, 2009 12:43AM


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.