Skip to content

Conversation

@trevorbayless
Copy link
Member

@trevorbayless trevorbayless commented Sep 7, 2023

Fixes the issue where losses against Stockfish are incorrectly appearing in the "Draws" tab (l.org/@/user/draws).

This incorporates just the draw query changes from #13553 as this change only adds matching the status id to those which are a draw. Similar logic is already used as part of the loss query here.

To allow losses against Stockfish to correctly appear under the "Losses" tab, we would also need to include this commit, but I know there was some concern about $or queries being slow and having ill effects on the db servers.

Fixes: #3815

@fitztrev
Copy link
Member

Was there still a concern about performance for this change to the query? Could we profile it

$ mongo

> use lichess
> db.game5.find({us: 'thibault', s: { $in: [32, 34] }, wid: { $exists: false }})
> db.game5.find({us: 'thibault', s: { $in: [32, 34] }, wid: { $exists: false }}).explain("executionStats")

@trevorbayless
Copy link
Member Author

I think profiling this would be a good idea. However, I believe the majority of the performance concerns were regarding the excluded commit which resolves Stockfish losses not appear under "Losses". This PR only addresses the "Draws" issue at this time.

To allow losses against Stockfish to correctly appear under the "Losses" tab, we would also need to include this commit, but I know there was some concern about $or queries being slow and having ill effects on the db servers.

I think profiling both changes would be beneficial and would determine if we can bring in the changes from my excluded commit as well.

@kraktus
Copy link
Member

kraktus commented Jul 9, 2024

Coming after the battle here, but how would we profile it?

@trevorbayless
Copy link
Member Author

trevorbayless commented Jul 9, 2024

Coming after the battle here, but how would we profile it?

fitztrev's comment looks like a reasonable approach to me to gain some insight on it.

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.

Losses vs the AI or anonymous players show up under the Draws tab

3 participants