-
Notifications
You must be signed in to change notification settings - Fork 75
List players with 0 points in stats viewer #234
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #234 +/- ##
==========================================
- Coverage 36.16% 36.15% -0.01%
==========================================
Files 121 121
Lines 5837 5838 +1
==========================================
Hits 2111 2111
- Misses 3726 3727 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Mhh, this isn't what we were going for, sorry 😅 What #132 wanted to do was to add only those players back to the stats viewer that have verified a legacy demon, or have accepted records on the legacy list - just adding all players will be a huge mess (just go through the pages returned by GET /players, there a lot of spam in there). And those players are fine if they get some non-null rank at the end of the stats viewer |
|
aaaaaaaa oops |
yes!! Sorry, the issue wasn't very descriptive 😭 |
|
added extra conditions, this should do the trick 😞 |
stadust
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't query the records table for each individual row of the players table - the production tables are just way too large for this to be efficient. E.g. with your new ranked_players view a simple select * from ranked_players limit 50 goes from 4ms to 400ms - that's 10000% slower (and I'm only running this on a local copy of the database from early last year, so in practice it'd probably be even worse). It'd make the server crawl to a halt I'm afraid.
The determination of including players with 0 points needs to happen when the score is initially computed, e.g. inside the recompute_*_score[s] stored procedures which populate the score column.
I do like the idea of using NULL vs 0.0 for separating out players that should and shouldn't be displayed though. E.g. setting score = 0.0 for players that only have legacy records/verifications or are creators, and setting everyone else to NULL instead. Then these queries can just filter out the players with NULL score.
I'll insist on rank being non-nullable though. That's how the endpoint is documented
|
i can't believe performance hasnt crossed my mind once |
|
new changes are purely logical so there shouldnt be any major performance issues haha |
Make "score" nullable, where score == 0 means "this player has approved records, verifications, but they do not give score anymore because they are legacy or progress records on extended demons", and score == NULL means "this player has no approved records or verifications whatsoever". Then have the stats viewer query all players that have non-NULL score, so that players with only legacy records (e.g. RioT) show up again. Signed-off-by: stadust <[email protected]>
50128e9 to
b1c343e
Compare
impl good now (am looking into test failures)
Modified the
ranked_playersview to include scoreless players and give them anullrankTo include scoreless players in the response of
/players/ranking, ascorelessquery parameter must be provided and set to true (to not break anything which may rely on ranks not being null)Resolves #132
License Acceptance
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.