I'm developing an online game site and I just can't figure out the best way to make de users ranking system.
My first approach was to create a Rank field in the user table that would be updated every hour. That approach is the easy one but it's also very CPU intensive because I'm expecting 10000+ users registered on the site.
My second approach was to display the ranking dynamically with a SQL query and PHP. This is a very good solution to TOP tables, justa a SQL query like
Code: Select all
select id,name from users order by points limit 10I'd like to show the ranking of one specific player on the player info, that is the problem! An easy way to calculate the ranking of a single user is to use the query
Code: Select all
select count(*) from users where points > player_pointAnybody can suggest something?
Thanks