[PR #15666] [MERGED] Fix unnecessary database JOINs in ApplyNavigations #14380

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

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/15666
Author: @andrewrabert
Created: 11/30/2025
Status: Merged
Merged: 12/13/2025
Merged by: @crobibero

Base: release-10.11.zHead: fix/conditional-applynavigations


📝 Commits (1)

  • 2ace116 Fix unnecessary database JOINs in ApplyNavigations

📊 Changes

1 file changed (+19 additions, -4 deletions)

View changed files

📝 Jellyfin.Server.Implementations/Item/BaseItemRepository.cs (+19 -4)

📄 Description

Slight performance opitmization. For example, when navigating to a Movie library via jellyfin-web:

https://localhost/Users/<UserId>/Items?SortBy=DateCreated%2CSortName%2CProductionYear&SortOrder=Descending&IncludeItemTypes=Movie&Recursive=true&Fields=PrimaryImageAspectRatio%2CMediaSourceCount&ImageTypeLimit=1&EnableImageTypes=Primary%2CBackdrop%2CBanner%2CThumb&StartIndex=0&ParentId=<ParentId>&Limit=100

I compared the performance of retrieving that URL using curl and two identical servers. This change resulted in a decrease from ~83ms to ~52ms in request duration.

$ hyperfine -r 200 ./before.sh ./after.sh
Benchmark 1: ./before.sh
  Time (mean ± σ):      83.8 ms ±   3.8 ms    [User: 8.8 ms, System: 4.2 ms]
  Range (min … max):    78.2 ms … 102.1 ms    200 runs
 
Benchmark 2: ./after.sh
  Time (mean ± σ):      52.1 ms ±   2.7 ms    [User: 8.9 ms, System: 4.0 ms]
  Range (min … max):    47.6 ms …  64.0 ms    200 runs
 
Summary
  ./after.sh ran
    1.61 ± 0.11 times faster than ./before.sh

🔄 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/15666 **Author:** [@andrewrabert](https://github.com/andrewrabert) **Created:** 11/30/2025 **Status:** ✅ Merged **Merged:** 12/13/2025 **Merged by:** [@crobibero](https://github.com/crobibero) **Base:** `release-10.11.z` ← **Head:** `fix/conditional-applynavigations` --- ### 📝 Commits (1) - [`2ace116`](https://github.com/jellyfin/jellyfin/commit/2ace11633d9ed245e4fe9fa793999312f7681a65) Fix unnecessary database JOINs in ApplyNavigations ### 📊 Changes **1 file changed** (+19 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `Jellyfin.Server.Implementations/Item/BaseItemRepository.cs` (+19 -4) </details> ### 📄 Description Slight performance opitmization. For example, when navigating to a Movie library via jellyfin-web: `https://localhost/Users/<UserId>/Items?SortBy=DateCreated%2CSortName%2CProductionYear&SortOrder=Descending&IncludeItemTypes=Movie&Recursive=true&Fields=PrimaryImageAspectRatio%2CMediaSourceCount&ImageTypeLimit=1&EnableImageTypes=Primary%2CBackdrop%2CBanner%2CThumb&StartIndex=0&ParentId=<ParentId>&Limit=100` I compared the performance of retrieving that URL using curl and two identical servers. This change resulted in a decrease from ~83ms to ~52ms in request duration. ``` $ hyperfine -r 200 ./before.sh ./after.sh Benchmark 1: ./before.sh Time (mean ± σ): 83.8 ms ± 3.8 ms [User: 8.8 ms, System: 4.2 ms] Range (min … max): 78.2 ms … 102.1 ms 200 runs Benchmark 2: ./after.sh Time (mean ± σ): 52.1 ms ± 2.7 ms [User: 8.9 ms, System: 4.0 ms] Range (min … max): 47.6 ms … 64.0 ms 200 runs Summary ./after.sh ran 1.61 ± 0.11 times faster than ./before.sh ``` --- <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:28:56 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14380