I need to consult a table by extracting from it the infos: <nome>
and <pontuacao>
, my tcc is a game where one of your options is to see a Ranking of players registered. as there is a possibility that the soft grow in number of users this query can become very heavy if it is to return all the tuples of the table.
What I want is to be able to recover the position of the current player and 5 positions above and 5 below to ease the load.
What I was able to do was:
select nome,pontuacao from jogador order by pontuacao DESC;
It does the whole table search and this can hurt the system later.
Would anyone know how to limit this query?