MySQL Forums
Forum List  »  Performance

Re: Slow query
Posted by: Rick James
Date: February 12, 2011 03:32PM

I can't answer the question without knowing which fields are in which tables. 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 ]

Also, add aliases to make it clear in the query:
SELECT  locId, location.city as city,latitude,
       longitude
    FROM  ip2isp
    join  location on ip2isp.location=locId
    WHERE  INET_ATON('x.x.x.x') BETWEEN start
      AND  end; 

Options: ReplyQuote


Subject
Views
Written By
Posted
3133
February 11, 2011 08:55AM
Re: Slow query
1004
February 12, 2011 03:32PM
1166
February 14, 2011 07:55AM
956
February 14, 2011 08:12AM
835
February 14, 2011 09:59AM
728
February 14, 2011 10:57AM
761
February 14, 2011 06:51PM
971
February 15, 2011 03:21AM
1160
February 15, 2011 11:17AM


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.