MySQL Forums
Forum List  »  Optimizer & Parser

Re: data design optimization
Posted by: Peter Brawley
Date: March 30, 2006 04:03PM

You just want rows where ActivityID = 0 and PeriodStart < _PeriodEnd and PeriodEnd > _PeriodStart? Why not just ...
)
SELECT * FROM BudgetActivities
WHERE WHERE ActivityID = 0
AND PeriodStart < _PeriodEnd
AND PeriodEnd > _PeriodStart
ORDER BY ActivityGroupID,ActivityID;

If that's still slow, try adding indexes on activitygroupid and on periodstart, periodend.

PB

Options: ReplyQuote


Subject
Views
Written By
Posted
2783
March 30, 2006 07:44AM
1816
March 30, 2006 09:02AM
2416
March 30, 2006 01:43PM
Re: data design optimization
1917
March 30, 2006 04:03PM
1787
March 31, 2006 04:59PM


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.