Results 1 to 5 of 5
Mar 19, 2011, 12:04 #1
what's field should be INDEX in mysql?
today, i checked my slow query log and saw lots of slow queries.
it's looks like:
SELECT uid,uname FROM usertbl WHERE country='us' ORDER BY lastlogin DESC LIMIT 0,20;
i INDEXED country field.
so should i index lastlogin field?
and one more question, should i use DISTINCT or GROUP BY to filter duplicate records?