I create a game in which players will gain levels. The basic information is in the table "char" (nickname, lvl, exp, money ...).
I want to make a ranking that will be updated on a regular basis and works in real time. I think it makes no sense to perform the "ORDER BY lvl" operation on the "char" table every time someone enters the "Ranking" tab on the site.
My plan is this:
1) Make an additional table: "ranking" in which the data will be physically sorted.
2) Create a trigger that will update the ranking every time someone reaches a new level or someone creates a new character. Does it make sense and is more efficient? If so, how can I do it? If not, how else to do it?