diff --git a/Server/src/SOR.Content/Handlers/ContentSyncHandler.cs b/Server/src/SOR.Content/Handlers/ContentSyncHandler.cs index 5e26d2b..92d253c 100644 --- a/Server/src/SOR.Content/Handlers/ContentSyncHandler.cs +++ b/Server/src/SOR.Content/Handlers/ContentSyncHandler.cs @@ -36,12 +36,15 @@ internal sealed class ContentSyncHandler : IMessageHandler var pageSize = Math.Clamp(req.PageSize, 1, 500); // Fetch one extra to detect HasMore without an additional COUNT query. + // AsSplitQuery avoids the cartesian product caused by two collection Includes. + // Without it EF emits a single JOIN that crosses Assets × AnimationBindings per card. var cards = await _catalogDb.CardDefinitions .Include(c => c.Assets) .Include(c => c.AnimationBindings) .Where(c => c.DefinitionVersion > req.SinceVersion) .OrderBy(c => c.DefinitionVersion) .Take(pageSize + 1) + .AsSplitQuery() .ToListAsync(ct); var hasMore = cards.Count > pageSize; diff --git a/deploy/k8s/configmap.yaml b/deploy/k8s/configmap.yaml index 0a3ea96..fd3bf07 100644 --- a/deploy/k8s/configmap.yaml +++ b/deploy/k8s/configmap.yaml @@ -16,7 +16,7 @@ data: WebSocket__MaxMessageSizeBytes: "1048576" Gateway__AuthTimeoutMs: "10000" Gateway__MaxMessagesPerSecond: "20" - Gateway__RemoteDispatchTimeoutMs: "10000" + Gateway__RemoteDispatchTimeoutMs: "15000" # NATS message bus Nats__Url: "nats://nats.stone-server.svc.cluster.local:4222"