MySQL Forums
Forum List  »  Optimizer & Parser

Re: Simple Query - No Join - But Temp. Table and file Sort :(
Posted by: Ravenous Bugblatter Beast
Date: October 21, 2006 05:20PM

Including the date in the select list is what requires both a temporary table and filesort. It also ambiguous unless you select MIN(e.evdate) or select MAX(e.evdate) - if a location has many events in the future, which date do you want - the first event or the last event or any random event?

If you can live without including the date in the result set you can avoid the filesort (but not the temporary table) using:

select distinct e.lockey,e.loc FROM sc_events e WHERE e.evdate >=1161428363 

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Simple Query - No Join - But Temp. Table and file Sort :(
2742
October 21, 2006 05:20PM


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.