MySQL Forums
Forum List  »  Optimizer & Parser

Re: Using Filesort and Temporary... Help?
Posted by: Rick James
Date: August 31, 2008 11:52PM

Compromise.

You are trying to do everything in the query. Find some middle ground that is easy enough to insert/update while being easy to SELECT from.

How often do "sales" start/end? Much less frequently than you are running this query. Suggest you do an UPDATE whenever a sale starts or stops. [Or whatever is meant by start_date/end_date.]

Maybe copy the group-0 prices into those that don't have prices?

Maybe a UNION could be used instead of the subselect and IF()?

Options: ReplyQuote


Subject
Views
Written By
Posted
3565
August 28, 2008 12:36AM
Re: Using Filesort and Temporary... Help?
2453
August 31, 2008 11:52PM


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.