Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use pre-aggregated data for unlocks on users list #1924

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/Helpers/database/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,8 @@ function getUserListByPerms(int $sortBy, int $offset, int $count, ?array &$dataO
default => "ua.User ASC ",
};

// TODO slow query (70) when ordering by NumAwarded
$query = "SELECT ua.ID, ua.User, ua.RAPoints, ua.TrueRAPoints, ua.LastLogin,
(SELECT COUNT(*) AS NumAwarded FROM Awarded AS aw WHERE aw.User = ua.User) NumAwarded
ua.achievements_unlocked NumAwarded
luchaos marked this conversation as resolved.
Show resolved Hide resolved
FROM UserAccounts AS ua
$whereQuery
ORDER BY $orderBy
Expand Down
Loading