MySQL Forums
Forum List  »  Performance

Re: Massive SELECTs for a hit counter
Posted by: matthew crowley
Date: December 13, 2004 10:42PM

something must be wrong with your indexes, or they aren't being used.

try

>>explain SELECT COUNT(*) FROM hits WHERE user_id = 1

to see if your indexes are being used the way you want. A few million rows on decent hardware (any p3 / p4, ATHLON) shouldn't take much more than 1 second or so, if that.

Try select count(user_id) from hits where user_id = 1. Same result, but it might give mysql a little bit more of a hint about what index to use. You can also try the select XX,YY from TABLE use index (INDEX) syntax.

let us know if that works for you

Options: ReplyQuote


Subject
Views
Written By
Posted
3269
December 13, 2004 04:18PM
Re: Massive SELECTs for a hit counter
2208
December 13, 2004 10:42PM
2326
December 14, 2004 11:45AM
2115
December 14, 2004 08:06PM
2168
December 14, 2004 12:55PM
2061
December 14, 2004 11:35PM
3421
December 16, 2004 01:45AM
2291
December 15, 2004 01:19PM
2251
December 15, 2004 01:39PM
2165
December 15, 2004 01:53PM


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.