Recently I have developed mobile game (LAMP + memcached).
The game has player's score table. The table has member_id
, name
, score
column.
I want to show leaderboard (global rank) to our user.
Just query SELECT * FROM score ORDER BY score DESC
, and show the resultset.
But I don't think it is good way. If users reach 20 million, this query seem to be terrible. What is the best practice in this case? Could you give me some advice?
And how can I check specific user's rank? I want to show each user rank where they are.