Skip to content

Commit

Permalink
Fix cartesian explosion in pref loading (#32434)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PJB3005 authored Sep 24, 2024
1 parent 4bca634 commit e36d735
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Content.Server/Database/ServerDbBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public ServerDbBase(ISawmill opsLog)
.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)
Expand Down

0 comments on commit e36d735

Please sign in to comment.