From f3ea0b8ad680246945d0fc5f0bd48f7d9d7e0d8e Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Tue, 24 Sep 2024 21:03:00 +0200 Subject: [PATCH] Fix cartesian explosion in pref loading 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/Database/ServerDbBase.cs b/Content.Server/Database/ServerDbBase.cs index 3c59c36f77e3fb..b750c13e2129b7 100644 --- a/Content.Server/Database/ServerDbBase.cs +++ b/Content.Server/Database/ServerDbBase.cs @@ -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)