Fix cartesian explosion in pref loading (#32434)

Lol .AsSingleQuery().

Some people's preferences wouldn't load on Lizard. Turns out the entire preferences set is loaded with a morbillion joins in a single query and one person had 240,000 (!!!) rows returned for their preferences query. Yeah.
This commit is contained in:
Pieter-Jan Briers
2024-09-24 22:43:02 +02:00
committed by GitHub
parent 4bca634ff6
commit e36d735064

View File

@@ -52,7 +52,7 @@ namespace Content.Server.Database
.ThenInclude(h => h.Loadouts)
.ThenInclude(l => l.Groups)
.ThenInclude(group => group.Loadouts)
.AsSingleQuery()
.AsSplitQuery()
.SingleOrDefaultAsync(p => p.UserId == userId.UserId, cancel);
if (prefs is null)