Deck fixes

This commit is contained in:
gamer147
2026-05-23 21:36:27 -04:00
parent d3b2970e11
commit 499e218be7
5 changed files with 103 additions and 6 deletions

View File

@@ -39,8 +39,14 @@ public class ViewerRepository : IViewerRepository
/// </summary>
public async Task<Models.Viewer?> GetViewerByShortUdid(long shortUdid)
{
// AsSplitQuery: each Include() collection runs as a separate SELECT instead of one giant
// LEFT JOIN with a cartesian product on the result set. The combined Decks+DeckCard+Cards+
// many-to-many-cosmetics shape was producing hundreds of thousands of duplicate rows after
// the import-time default-deck clone landed (24 decks × 40 DeckCards × N cosmetics each),
// pushing /load/index to ~17 s/request. Split queries take O(rows) total instead.
return await _dbContext.Set<Models.Viewer>()
.AsNoTracking()
.AsSplitQuery()
.Include(v => v.MissionData)
.Include(v => v.Info).ThenInclude(i => i.SelectedEmblem)
.Include(v => v.Info).ThenInclude(i => i.SelectedDegree)