MySQL Forums
Forum List  »  Optimizer & Parser

Re: Simple Query - No Join - But Temp. Table and file Sort :(
Posted by: Toa Sty
Date: October 21, 2006 10:55AM

 
 Using code like this will work be a bit like <pre> :)  



As for the query, not sure how you can make it not use temps and filesorts off the top of my head. If you were using = rather than >= you wouldn't be seeing them as your evdate_2 index would be used.

If you're not bothered about the order of the results (after grouping) you could add 'order by NULL' to drop the filesort but you'll probably not see much noticeable performance increase if any.


Actually - how come you're doing a GROUP BY but not using any aggregation functions (eg SUM, COUNT, MIN) on the non-grouped cols? You'll be getting unpredictable values for evdate and loc (unless they're always the same for any value of lockey, in which case you're data might be in need of normalisation, and if you normalise you won't need the GROUP BY :)

Toasty

-----------------------------------------
email: 'toasty'*3 at gmail

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Simple Query - No Join - But Temp. Table and file Sort :(
2545
October 21, 2006 10:55AM


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.