]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix cartesian explosion in pref loading (#32434)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Tue, 24 Sep 2024 20:43:02 +0000 (22:43 +0200)
committerGitHub <noreply@github.com>
Tue, 24 Sep 2024 20:43:02 +0000 (22:43 +0200)
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.

Content.Server/Database/ServerDbBase.cs

index 3c59c36f77e3fbba85ebd7c60a16399c686b433f..b750c13e2129b712683473a54c454c1ec9db0840 100644 (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)