This is an inefficient way to update a denormalized field on an Player
Django model. The field essentially stores the position of the player on the leaderboard, which is a requirement for a system we have for displaying "nearby" players to a given player.
for position, player in enumerate(Player.objects.order_by('-score')):
player.position = position + 1
player.save()
Is there a way to perform this update in one SQL query instead? The database backend we're using is MySQL.
Thanks for your time!