php - Best practices storing, modifying and retrieving user reputation data -
suppose have mysql table 500,000 rows. each row has field numerical value in we'll call points. every time user on site points updated in positive or negative direction based on activity. it's easy put index on points field , retrieve sorted list of users points. however, when need know 1 random row falls in list? if write code pull user's profile , display "rank" in relation other users, system put in place make information available efficiently, ie without selecting whole users table.
thanks help.
does doing direct approach (using index have) work? i'm thinking of like:
select count(*) user_points points > x
where x
number of points user looking at.
Comments
Post a Comment