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 deltanedas
parent c0f24b1748
commit 7974306676
1 changed files with 1 additions and 1 deletions

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)