The score is fine - but getting the current rank in a song isn't so easy, because each time I must check how many people are above you. This is a bit complex because you have to compare both score and date, and this is in a database table with over 3.5million rows .