[PR #15927] [CLOSED] Fix EF Core Cartesian Explosion and SQLite migration bugs #14468

Closed
opened 2026-02-07 07:30:19 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/15927
Author: @ZeusCraft10
Created: 1/2/2026
Status: Closed

Base: masterHead: fix/ef-core-performance-and-schema


📝 Commits (2)

  • 60e649f Fix Live TV audio by enforcing HLS spec compliance in Direct Play evaluation
  • bc7fad5 Fix EF Core Cartesian Explosion and SQLite migration bugs

📊 Changes

5 files changed (+32 additions, -6 deletions)

View changed files

📝 CONTRIBUTORS.md (+1 -0)
📝 Jellyfin.Server.Implementations/Item/BaseItemRepository.cs (+16 -3)
📝 src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250326065026_AddInheritedParentalRatingSubValue.cs (+1 -1)
📝 src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250327101120_AddKeyframeData.Designer.cs (+7 -1)
📝 src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250327171413_AddHdr10PlusFlag.Designer.cs (+7 -1)

📄 Description

Problem Description

This PR addresses Issue #15917 where loading TV shows with many episodes caused an EF Core Cartesian Explosion due to the default QuerySplittingBehavior.SingleQuery. It also resolves the SQLite schema error
o such column: u.MaxParentalAgeRating by fixing a migration bug and refreshing stale designer snapshots.

Proposed Changes

  • BaseItemRepository: Removed global .AsSingleQuery() and implemented selective .AsSplitQuery() in ApplyNavigations when 2+ collections are loaded.
  • Migrations: Fixed bug in 20250326065026_AddInheritedParentalRatingSubValue.cs (wrong column dropped in Down()).
  • Snapshots: Corrected stale designer snapshots in 20250327101120_AddKeyframeData.Designer.cs and 20250327171413_AddHdr10PlusFlag.Designer.cs.

Verification

  • Verified build success for SQLite provider and Implementations project.
  • Logic confirms selective splitting only for complex multi-collection queries, preserving performance for simple ones.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/15927 **Author:** [@ZeusCraft10](https://github.com/ZeusCraft10) **Created:** 1/2/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/ef-core-performance-and-schema` --- ### 📝 Commits (2) - [`60e649f`](https://github.com/jellyfin/jellyfin/commit/60e649f943fceb5a97de9f4e70cc21f04e95d1fc) Fix Live TV audio by enforcing HLS spec compliance in Direct Play evaluation - [`bc7fad5`](https://github.com/jellyfin/jellyfin/commit/bc7fad524f83bbd4460022d5aea5ebb3d84a6df2) Fix EF Core Cartesian Explosion and SQLite migration bugs ### 📊 Changes **5 files changed** (+32 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTORS.md` (+1 -0) 📝 `Jellyfin.Server.Implementations/Item/BaseItemRepository.cs` (+16 -3) 📝 `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250326065026_AddInheritedParentalRatingSubValue.cs` (+1 -1) 📝 `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250327101120_AddKeyframeData.Designer.cs` (+7 -1) 📝 `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250327171413_AddHdr10PlusFlag.Designer.cs` (+7 -1) </details> ### 📄 Description ## Problem Description This PR addresses Issue #15917 where loading TV shows with many episodes caused an EF Core Cartesian Explosion due to the default QuerySplittingBehavior.SingleQuery. It also resolves the SQLite schema error o such column: u.MaxParentalAgeRating by fixing a migration bug and refreshing stale designer snapshots. ## Proposed Changes - **BaseItemRepository**: Removed global .AsSingleQuery() and implemented selective .AsSplitQuery() in ApplyNavigations when 2+ collections are loaded. - **Migrations**: Fixed bug in 20250326065026_AddInheritedParentalRatingSubValue.cs (wrong column dropped in Down()). - **Snapshots**: Corrected stale designer snapshots in 20250327101120_AddKeyframeData.Designer.cs and 20250327171413_AddHdr10PlusFlag.Designer.cs. ## Verification - Verified build success for SQLite provider and Implementations project. - Logic confirms selective splitting only for complex multi-collection queries, preserving performance for simple ones. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:30:19 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14468