The amount of data is hundreds of thousands, use mysql, sort by a score field in the table...check and spit out every time, the disk IO alone is enough for you, and there is no need to consider the efficiency of SQL query. There is no need to consider performance issues with cold data. I guess this is hot data. Don't use mysql to check, use redis, it can be easily done with a SortedSet.
Export data and use programming language to implement quick sorting algorithm. You cannot expect SQL to efficiently implement various sorting algorithms and just use them.
This topic is interesting, but are your questions complete enough? Because the amount of data is hundreds of thousands, if we only sort by scores, most people may have the same score. Even if the scores are as high as millions, the top 5 and the bottom 5 may all have the same score.
For example, the current games from Tencent are all ranked in the circle of friends. This is another problem. It is very technical.
The amount of data is hundreds of thousands, use mysql, sort by a score field in the table...check and spit out every time, the disk IO alone is enough for you, and there is no need to consider the efficiency of SQL query.
There is no need to consider performance issues with cold data. I guess this is hot data. Don't use mysql to check, use redis, it can be easily done with a SortedSet.
In this case, the efficiency problem cannot be solved at the SQL level
Export data and use programming language to implement quick sorting algorithm. You cannot expect SQL to efficiently implement various sorting algorithms and just use them.
This topic is interesting, but are your questions complete enough? Because the amount of data is hundreds of thousands, if we only sort by scores, most people may have the same score. Even if the scores are as high as millions, the top 5 and the bottom 5 may all have the same score.
For example, the current games from Tencent are all ranked in the circle of friends. This is another problem. It is very technical.