mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
[PR #15803] Removing N+1 queries from the /items/Latest endpoint #14245
Labels
No labels
area:database
awaiting-feedback
backend
blocked
breaking change: web api
bug
build
ci
confirmed
discussion needed
dotnet future
downstream
duplicate
EFjellyfin.db
enhancement
feature
future
github-actions
good first issue
hdr
help wanted
invalid
investigation
librarydb
live-tv
lyrics
media playback
music
needs testing
nuget
performance
platform
pull-request
question
regression
release critical
requires-web
roadmap
security
security
stale
support
syncplay
ui & ux
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/jellyfin#14245
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/15803
Author: @JackDanger
Created: 12/16/2025
Status: 🔄 Open
Base:
master← Head:jackdanger/optimizing-latest-endpoint📝 Commits (3)
0a2bdc0Optimize /items/Latest: batch DTO conversion to reduce loop overhead0173e1dAdd batch user data retrieval to reduce N+1 queries9a5f214Optimize DtoService to use batch user data retrieval📊 Changes
4 files changed (+170 additions, -13 deletions)
View changed files
📝
Emby.Server.Implementations/Dto/DtoService.cs(+58 -7)📝
Emby.Server.Implementations/Library/UserDataManager.cs(+77 -0)📝
Jellyfin.Api/Controllers/UserLibraryController.cs(+13 -6)📝
MediaBrowser.Controller/Library/IUserDataManager.cs(+22 -0)📄 Description
This PR is 3 discrete commits that address the N+1 queries on the endpoint that loads libraries into the home screen.
Prior to this change a sizable library (thousands of movies, hundreds of thousands of audio tracks) would not load faster than 30s on even very fast hardware.
After this change the endpoint returns even very large collections within 100-200ms.
This may address https://github.com/jellyfin/jellyfin/issues/15742
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.