MySQL Forums
Forum List  »  Newbie

Tunning or optimizing a query
Posted by: Mike Henderson
Date: April 05, 2005 07:16AM

Can anyone give information on optimizing or tunning a query that takes forever to run? I have finally got the results that I want from my query but now it seems to take forever to run. Here is the query:
SELECT t.ranum, t.serloc, t.timeanddate
FROM transtable t,
(SELECT ranum, MAX(timeanddate) AS MAX_DATE FROM transtable WHERE ranum NOT LIKE '%AC' GROUP BY ranum)
WHERE t.ranum = b.ranum AND t.timeanddate = b.MAX_DATE AND t.serloc NOT LIKE '5410179601'

This query takes 77.441 second to return the first 200 results. I am using mysql 4.1.9 and running my queries thru the latest MySQL query browser tool to check results.

Options: ReplyQuote


Subject
Written By
Posted
Tunning or optimizing a query
April 05, 2005 07:16AM


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.