MySQL Forums
Forum List  »  Optimizer & Parser

Re: Large database
Posted by: KimSeong Loh
Date: February 14, 2007 06:47PM

select count(event_id) as c, field, field2,f ield3 from xyz group by count limit 10;

Index on count might help, or maybe it won't.

select count(event_id) as c, field, field2,f ield3 from xyz where field='value' group by count limit 10;

If you have a where like this, then index on (field,count) will be very helpful.

Options: ReplyQuote


Subject
Views
Written By
Posted
3353
January 12, 2007 07:45AM
2103
February 09, 2007 01:42AM
1940
February 14, 2007 06:55AM
Re: Large database
2160
February 14, 2007 06:47PM
2053
February 15, 2007 05:35AM
2168
February 15, 2007 05:13PM


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.