I
I
Igor Samokhin2015-09-01 21:38:59
MySQL
Igor Samokhin, 2015-09-01 21:38:59

What is the best way to get TOP players in mysql?

Good evening,
there is a task to display to users in the game the top players sorted by some key. Will the selection slow down if I do the usual select order by param desc for each user?
What approaches exist for the optimal output of the top?
While I see the obvious - we display it once for the user's session and then take it from the session.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AlikDex, 2015-09-01
@AlikDex

y. Will the selection slow down if I do the usual select order by param desc for each user
will not. All fields by which you will sort and select should be indexed
Never do this. Sessions are not for that. You don't need to cache queries either. Let the database handle it.

D
Dmitry, 2015-09-01
@thewind

memcached, sphinx

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question