diff options
| author | Shadowghost <Shadowghost@users.noreply.github.com> | 2026-11-20 07:25:05 -0500 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2026-11-20 07:25:05 -0500 |
| commit | ddb9fb275e946b53dd9faac9d65002b47833821b (patch) | |
| tree | 44365478319193c68f9d23c30563d7b90d5a85a1 /src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration | |
| parent | a2ca4a7b84e89957547a9fb04a190b139c86e72f (diff) | |
Backport pull request #18258 from jellyfin/release-12.z
Look up descendants by parent instead of a correlated EXISTS
Original-merge: e60484a1cef1ceca4aea7135396178139dc93132
Merged-by: crobibero <cody@robibe.ro>
Backported-by: Cody Robibero <cody@robibe.ro>
Diffstat (limited to 'src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration')
| -rw-r--r-- | src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/AncestorIdConfiguration.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/AncestorIdConfiguration.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/AncestorIdConfiguration.cs index 67269153d3..38a9c9a548 100644 --- a/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/AncestorIdConfiguration.cs +++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/AncestorIdConfiguration.cs @@ -13,7 +13,8 @@ public class AncestorIdConfiguration : IEntityTypeConfiguration<AncestorId> public void Configure(EntityTypeBuilder<AncestorId> builder) { builder.HasKey(e => new { e.ItemId, e.ParentItemId }); - builder.HasIndex(e => e.ParentItemId); + // Covers ItemId so descendant lookups by parent never touch the table. + builder.HasIndex(e => new { e.ParentItemId, e.ItemId }); builder.HasOne(e => e.ParentItem).WithMany(e => e.Children).HasForeignKey(f => f.ParentItemId); builder.HasOne(e => e.Item).WithMany(e => e.Parents).HasForeignKey(f => f.ItemId); } |
