Skip to content

Commit

Permalink
Fix expensive beatmap leaderboard query
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed Nov 16, 2024
1 parent 48603ac commit aa7ec7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/helpers/DroidHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export abstract class DroidHelper {
score.hash as hash,
score.pp as pp
FROM ${constructOfficialDatabaseTable(OfficialDatabaseTables.score)} score, ${constructOfficialDatabaseTable(OfficialDatabaseTables.user)} user
WHERE score.hash = ? AND score.score > 0 ORDER BY score.pp DESC LIMIT ? OFFSET ?;`,
WHERE score.hash = ? AND score.score > 0 AND user.id = score.uid ORDER BY score.pp DESC LIMIT ? OFFSET ?;`,
[hash, scoresPerPage, (page - 1) * scoresPerPage],
);

Expand Down

0 comments on commit aa7ec7a

Please sign in to comment.