MySQL Forums
Forum List  »  Performance

Re: Poor Performance with tables over 1Million entries
Posted by: Aftab Khan
Date: April 09, 2009 02:52AM

2. Used OR and Group By with Having: ~0.3sec
SELECT * FROM DataMap
WHERE dataId IN (1,2,3)
GROUP BY itemId
HAVING COUNT(dataId)=3
LIMIT 20

I Replaced
dataId=1 OR dataId=2 OR dataId=3
with
dataId IN (1,2,3)

hopefully you will see a speed difference

Options: ReplyQuote




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.