Skip to content

Conversation

@dfabulich
Copy link
Collaborator

Prior to #1256, we were excluding special reviews, embargoed reviews, and sandboxed reviews with a where clause, but this meant that some games were missing from gameRatingsSandbox0, when all of a game's reviews were special reviews. In #1256, I removed the where clause and turned them into criteria on the join clauses.

This worked fine for special reviews and embargoed reviews, but it didn't work for sandboxed reviews. We did a left join to the users table, excluding sandboxed users there, but we didn't use the results of that join. We never used users.userid for anything, and we never excluded any sandboxed reviews in the criteria for the reviews table.

I've removed the join to users and replaced it with another criterion on the join to the reviews table, excluding reviews where the userid is sandboxed.

I've confirmed that this still excludes special and embargoed reviews, and now it excludes sandboxed reviews, too. Also, I've confirmed that the number of rows matches the number of rows in the games table, so every game has a matching row in gameRatingsSandbox0.

Fixes #1263

This is impossible-ish to test for folks who don't have access to the prod database (containing the actual sandboxed users), but:

before

MariaDB [ifdb]> select * from gameRatingsSandbox0_mv where gameid = 'aearuuxv83plclpl' \G
*************************** 1. row ***************************
          gameid: aearuuxv83plclpl
          rated1: 4
          rated2: 0
          rated3: 6
          rated4: 35
          rated5: 211
 numRatingsInAvg: 256
 numRatingsTotal: 257
numMemberReviews: 25
       avgRating: 4.75390625
    stdDevRating: 0.6480020186781346
        starsort: 4.647653112791922
         updated: 2025-01-18

after

MariaDB [ifdb]> select * from gameRatingsSandbox0_mv where gameid = 'aearuuxv83plclpl' \G
*************************** 1. row ***************************
          gameid: aearuuxv83plclpl
          rated1: 0
          rated2: 0
          rated3: 6
          rated4: 34
          rated5: 211
 numRatingsInAvg: 251
 numRatingsTotal: 251
numMemberReviews: 23
       avgRating: 4.816733067
    stdDevRating: 0.44439726455859596
        starsort: 4.725262803850697
         updated: 2025-01-19

Prior to #1256, we were excluding special reviews, embargoed reviews, and sandboxed reviews with a `where` clause, but this meant that some games were missing from `gameRatingsSandbox0`, when all of a game's reviews were special reviews. In #1256, I removed the `where` clause and turned them into criteria on the `join` clauses.

This worked fine for special reviews and embargoed reviews, but it didn't work for sandboxed reviews. We did a left join to the `users` table, excluding sandboxed users there, but we didn't use the results of that join. We never used `users.userid` for anything, and we never excluded any sandboxed reviews in the criteria for the `reviews` table.

I've removed the join to `users` and replaced it with another criterion on the join to the `reviews` table, excluding reviews where the `userid` is sandboxed.

I've confirmed that this still excludes special and embargoed reviews, and now it excludes sandboxed reviews, too. Also, I've confirmed that the number of rows matches the number of rows in the games table, so every game has a matching row in `gameRatingsSandbox0`.

Fixes #1263
@dfabulich dfabulich requested a review from salty-horse January 19, 2025 22:21
@dfabulich
Copy link
Collaborator Author

I'm just going to merge this, because @salty-horse doesn't have any data to use to test it.

@dfabulich dfabulich merged commit 02c69b3 into main Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gameRatingsSandbox0_mv counts reviews from sandboxed users

2 participants