Library Slow Query - 'Recommended' Tab

Server Version#: v1.41.9.9961-46083195d
Player Version#: 1.109.0.329-ea562b95

For the past week or so, my TV show and movie libraries have been loading quite slow in Plex, both locally and remotely. Some times the library doesn’t at all. Once they load, they seem to cache for a bit and perform fine, but after a while the issue returns. I have tried this on my android phone locally and remote, on my windows client both laptop and desktop, and on my Nvidia Shield Pro. All experiencing the same issue. No issues playing any media.

Every time my library query is slow these errors occur (see the attached log snips for actual slow query WARN):

Aug 05, 2025 20:38:45.483 [134065682357048] WARN - [Req#59dbc] QueryParser: Invalid field 'contentDirectoryID' found, ignoring.
Aug 05, 2025 20:38:45.483 [134065682357048] WARN - [Req#59dbc] QueryParser: Invalid field 'pinnedContentDirectoryID' found, ignoring.
Aug 05, 2025 20:11:48.687 [134065757924152] WARN - Held transaction for too long (/home/runner/_work/plex-media-server/plex-media-server/Statistics/StatisticsManager.cpp:288): 0.470000 seconds

Plex Media Server warn log libraries.txt (48.2 KB)

On both Reddit and the Plex Forums users have mentioned these Errors, but no real solution or cause was given. Other than using a previous plex media server version I couldn’t find anything.

I’m running my Plex Media Server in docker (linuxserver image) on my NUC with N100 cpu 16GB RAM, connected to my NAS (containing media) via a 2.5 Gb/s switch. Using nfs mounts to mount files from NAS onto my NUC. Running about 30 containers on the NUC.

I ran the DBRepair script provided by @ChuckPA twice, but it didn’t seem to help.

I can provide actual debug logs if necessary, don’t have time to provide them atm.

Curious to see how many respond. Thanks for reading!

Edit: Saw your messages in an old related post, so I’'m @’ing you @Atomatth

  1. Query parser errors are 100% harmless — and have ALWAYS been – ignore
  2. “Held transaction too long” tell us the server is busy. It’s usually busy because the DB is fragmented and needs a proper reordering.

The N100 (which I have here) works just fine with a DB which has had DBRepair run on it to repack the DB (remove the indirection links inside the DB)

I very much would like to see the DBRepair.log file as well as know how much media ( approx item count for each type of library PMS is indexing )

I used the ‘show log’ feature from the DBRepair.sh:

==================================================================================
2025-08-03 15.33.40 - ============================================================
2025-08-03 15.33.40 - Session start: Host is Docker
2025-08-03 15.34.12 - Auto    - FAIL - PMS runnning
2025-08-03 15.34.28 - Stop    - PASS
2025-08-03 15.34.34 - Auto    - START
2025-08-03 15.34.40 - Check   - Check com.plexapp.plugins.library.db - PASS
2025-08-03 15.34.51 - Check   - Check com.plexapp.plugins.library.blobs.db - PASS
2025-08-03 15.34.51 - Check   - PASS
2025-08-03 15.36.14 - Repair  - Export databases - PASS
2025-08-03 15.36.45 - Repair  - Import - PASS
2025-08-03 15.36.48 - Repair  - Verify main database - PASS (Size: 359MB/339MB).
2025-08-03 15.36.48 - Repair  - Verify blobs database - PASS (Size: 740MB/746MB).
2025-08-03 15.36.48 - Repair  - Making repaired databases active
2025-08-03 15.36.48 - Repair  - Move files - PASS
2025-08-03 15.36.48 - Repair  - PASS
2025-08-03 15.36.48 - Repair  - PASS
2025-08-03 15.36.49 - Reindex - MakeBackup com.plexapp.plugins.library.db - PASS
2025-08-03 15.36.49 - Reindex - MakeBackup com.plexapp.plugins.library.blobs.db - PASS
2025-08-03 15.36.49 - Reindex - MakeBackup - PASS
2025-08-03 15.36.53 - Reindex - Reindex: com.plexapp.plugins.library.db - PASS
2025-08-03 15.36.54 - Reindex - Reindex: com.plexapp.plugins.library.blobs.db - PASS
2025-08-03 15.36.54 - Reindex - PASS
2025-08-03 15.36.54 - Reindex - PASS
2025-08-03 15.36.54 - Auto    - COMPLETED
2025-08-03 15.37.43 - Start   - PASS
2025-08-03 15.39.16 - Exit    - Delete temp files.
2025-08-03 15.39.17 - Session end. Sun Aug  3 15:39:17 CEST 2025
2025-08-03 15.39.17 - ============================================================
2025-08-06 19.44.03 - ============================================================
2025-08-06 19.44.03 - Session start: Host is Docker
2025-08-06 19.44.22 - Stop    - PASS
2025-08-06 19.44.50 - Check   - Check com.plexapp.plugins.library.db - PASS
2025-08-06 19.45.01 - Check   - Check com.plexapp.plugins.library.blobs.db - PASS
2025-08-06 19.45.01 - Check   - PASS
2025-08-06 19.46.24 - Repair  - Export databases - PASS
2025-08-06 19.46.55 - Repair  - Import - PASS
2025-08-06 19.46.58 - Repair  - Verify main database - PASS (Size: 342MB/341MB).
2025-08-06 19.46.59 - Repair  - Verify blobs database - PASS (Size: 750MB/750MB).
2025-08-06 19.46.59 - Repair  - Making repaired databases active
2025-08-06 19.46.59 - Repair  - Move files - PASS
2025-08-06 19.46.59 - Repair  - PASS
2025-08-06 19.47.13 - Auto    - START
2025-08-06 19.47.17 - Check   - Check com.plexapp.plugins.library.db - PASS
2025-08-06 19.47.17 - Check   - Check com.plexapp.plugins.library.blobs.db - PASS
2025-08-06 19.47.17 - Check   - PASS
2025-08-06 19.48.34 - Repair  - Export databases - PASS
2025-08-06 19.49.05 - Repair  - Import - PASS
2025-08-06 19.49.08 - Repair  - Verify main database - PASS (Size: 341MB/341MB).
2025-08-06 19.49.08 - Repair  - Verify blobs database - PASS (Size: 750MB/750MB).
2025-08-06 19.49.08 - Repair  - Making repaired databases active
2025-08-06 19.49.08 - Repair  - Move files - PASS
2025-08-06 19.49.08 - Repair  - PASS
2025-08-06 19.49.08 - Repair  - PASS
2025-08-06 19.49.09 - Reindex - MakeBackup com.plexapp.plugins.library.db - PASS
2025-08-06 19.49.09 - Reindex - MakeBackup com.plexapp.plugins.library.blobs.db - PASS
2025-08-06 19.49.09 - Reindex - MakeBackup - PASS
2025-08-06 19.49.13 - Reindex - Reindex: com.plexapp.plugins.library.db - PASS
2025-08-06 19.49.13 - Reindex - Reindex: com.plexapp.plugins.library.blobs.db - PASS
2025-08-06 19.49.13 - Reindex - PASS
2025-08-06 19.49.13 - Reindex - PASS
2025-08-06 19.49.13 - Auto    - COMPLETED
2025-08-06 19.49.50 - Check   - PASS
2025-08-06 19.49.51 - Reindex - MakeBackup com.plexapp.plugins.library.db - PASS
2025-08-06 19.49.51 - Reindex - MakeBackup com.plexapp.plugins.library.blobs.db - PASS
2025-08-06 19.49.51 - Reindex - MakeBackup - PASS
2025-08-06 19.49.55 - Reindex - Reindex: com.plexapp.plugins.library.db - PASS
2025-08-06 19.49.55 - Reindex - Reindex: com.plexapp.plugins.library.blobs.db - PASS
2025-08-06 19.49.55 - Reindex - PASS
2025-08-06 19.49.55 - Reindex - PASS
2025-08-06 19.50.03 - Prune   - START
2025-08-06 19.50.07 - Prune   - START
2025-08-06 19.50.08 - Prune   - Removing 17805 files.
2025-08-06 19.50.08 - Prune   - PASS.
2025-08-06 19.50.08 - Prune   - PASS
2025-08-06 19.50.30 - Start   - PASS
2025-08-06 19.50.41 - Exit    - Delete temp files.
2025-08-06 19.50.41 - Session end. Wed Aug  6 19:50:41 CEST 2025
2025-08-06 19.50.41 - ============================================================
2025-08-07 18.31.52 - ============================================================
2025-08-07 18.31.52 - Session start: Host is Docker
==================================================================================

I also included my entire Plex Media Server.log and Plex Debug.log excluding sensitive info (hopefully). Had to delete some lines due to file size. Hope this helps.

The problem of long loading library still occurs. I have 9 libraries, it seems to only occur in the ‘Movies’ and ‘TV Series’ libraries, not in the others as far as I could tell. The loading occurred today around 18:29, so you could check the log there.

Did you just add or is someone adding content to playlists ?

I see a lot of that activity in there (which does a lot of DB activity)

I see only one SLOW QUERY in that segment.
Occasional instances are normal when adding media or updating metadata.

How often is this occurring?

This is related to my issue from the other week.

I have a N100 system here. Would it make sense for me to get the databases, reload metadata, and try to reproduce ?

There wasn’t any new content actually being added at that time and I don’t use playlists. I did re-add a decent amount of TV shows about 1,5 week ago, which could be the cause, but I let Plex run its Tasks overnight. The log I provided was from during day, but the issue was still occuring.

The issue occurs multiple times a day. Like I said, the library stays cashed for a little while, then if you leave the client alone for a while, the loading issue is back.

Another container that could contribute to this is Bazarr, which I also recently updated and has been more or less constantly (re-)adding and syncing subtitle files. Both to new TV shows added, but also upgrading existing ones. So I guess this could explain the amount of DB activity, even though their file size is tiny?

Now that I’ve typed it out, I’m leaning towards Bazarr pushing subs causing DB to be busy.

Not sure? You could try. But it might be difficult to replicate the issue. I have multiple containers running which can influence my PMS. Arr stacks (yes plural), Kometa, Plex-auto-languages, tautulli, etc.

Before blaming all the stacks, I’ve had no issues for the past months. Just this past week.

If you’d like me to provide you with the DBs, let me know :slight_smile:

lets prove its not the stacks, disable them and then see if the issue occurs. Then one by one re-enable them until it happens again. Things like Kometa can and often do hammer the database.

My offer to help was part of a “Process of elimination” .

As was suggested before I could say it, Turn things off and slowly turn back on until the point of failure.

I am having similar issues. Home screen load fails for movies and does not display, and then when you go to movies it fails. Can click on retry and then after about a min they will come up and display. going back to home screen still does not refresh movies. have to exit and come back in and then they will display. I see this behavior, on Roku, IOS, windows and it is consistent behavior leading me to think it is the server. I have used ChckPa tool (which is great), performed optimize and clean bundles. com.plexapp.plugins.library.db is about 1.4G. Plex Version 1.42.0.9975. Running on Windows 11 Pro 13th Gen Intel(R) Core™ i7-1365U with 32G Ram and running on NVMe SSD dedicated for Plex separate from SDD NVMe for OS on different drive.

any suggestions I should try to resolve the performance issues? This has been happening for several releases now.

The held transaction for too long warning is frequently seen in the logs. Held transaction for too long (D:\gha\plex-media-server\plex-media-server\Statistics\StatisticsManager.cpp:288): 1.546875 seconds

[Req#8c4cde] SLOW QUERY: It took 906.250000 ms to retrieve 24 items.
[Req#8c4cd3] SLOW QUERY: It took 625.000000 ms to retrieve 24 items.
[Req#8c79c0] SLOW QUERY: It took 406.250000 ms to retrieve 50 items.

2025-08-03 07.05.13 – Session start: Host is Windows 10 (Build 26100)
2025-08-03 07.05.13 – Stop - START
2025-08-03 07.05.14 – Stop - PASS
2025-08-03 07.05.14 – Auto - START
2025-08-03 07.10.24 – Repair - Export databases - PASS
2025-08-03 07.12.04 – Repair - Import - PASS
2025-08-03 07.12.41 – Repair - Verify main database - PASS
2025-08-03 07.12.44 – Repair - Verify blobs database - PASS
2025-08-03 07.12.44 – Reindexing Main DB
2025-08-03 07.12.58 – Reindexing Blobs DB
2025-08-03 07.13.04 – Reindexing complete.
2025-08-03 07.13.04 – Moving current DBs to DBTMP and making new databases active
2025-08-03 07.13.04 – Auto - PASS
2025-08-03 07.13.04 – Start - START
2025-08-03 07.13.04 – Start - PASS
2025-08-03 07.13.04 – Exit - Deleted temp files.
2025-08-03 07.13.04 – Session end. 08/03/2025 07:13:04

@JB275 Please create a new thread and include a copy of your server logs

Sorry for the late reply. I forgot to clarify in my initial post that the slow query was taking place in the ‘Recommended’ tab of my libraries, not in the complete library or collections tab.

I seemed to have pinpointed it down to a smart filter which was causing the slow query. I had a collection in my TV Show library which was using ‘Unwatched Episodes’ as a parameter and I could clearly see that it was causing the slowly query when unpinning and repinning the collection. I have now changed this parameter to ‘Episodes Unwatched’ and the issue is no longer there. As a precaution for future delays I limited my pinned collections to a limit of 60 (most of them displaying randomly) for all libraries. Everything is much snappier now.

Funny enough, this collection existed for quite a while already, so I assume something has changed on Plex’s side for this issue to occur.

Anyway, hope this helps someone else in the future.

1 Like

Thank you, I just figured out why my recommended tab has been taking so long to load in one library.

You’re welcome. Glad it was of help!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.