From 9a07d4336b9766573c8ae60743d1294750ca3a22 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Wed, 12 Aug 2026 07:43:12 +0200 Subject: Make the media stream filter index covering --- .../ModelConfiguration/MediaStreamInfoConfiguration.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/MediaStreamInfoConfiguration.cs') diff --git a/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/MediaStreamInfoConfiguration.cs b/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/MediaStreamInfoConfiguration.cs index fc4e96cf8a..48c537bbd3 100644 --- a/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/MediaStreamInfoConfiguration.cs +++ b/src/Jellyfin.Database/Jellyfin.Database.Implementations/ModelConfiguration/MediaStreamInfoConfiguration.cs @@ -13,6 +13,9 @@ public class MediaStreamInfoConfiguration : IEntityTypeConfiguration builder) { builder.HasKey(e => new { e.ItemId, e.StreamIndex }); - builder.HasIndex(e => new { e.StreamType, e.ItemId }); + + // Covering index for the stream filters. ItemId comes second because it is what they project and + // dedupe on; Language and IsExternal follow only to keep their predicates off the table. + builder.HasIndex(e => new { e.StreamType, e.ItemId, e.Language, e.IsExternal }); } } -- cgit v1.2.3