Did you delete or move a whole bunch of media and put it in a new section?
PMS is deleting it and adding it back with new ID numbers.
It’s struggling because it’s thrashing the DB pretty hard
Jul 23, 2025 11:26:11.260 [140075340704568] WARN - [Req#e514] SLOW QUERY: It took 320.000000 ms to retrieve 90 items.
Jul 23, 2025 11:26:11.263 [140075333626680] WARN - [Req#e520] SLOW QUERY: It took 350.000000 ms to retrieve 90 items.
Jul 23, 2025 11:26:11.276 [140075284433720] WARN - [Req#e518] SLOW QUERY: It took 260.000000 ms to retrieve 90 items.
.
.
.
Jul 23, 2025 11:26:17.240 [140075333626680] WARN - [Req#e586] SLOW QUERY: It took 310.000000 ms to retrieve 90 items.
Jul 23, 2025 11:26:17.241 [140075360324408] WARN - [Req#e593] SLOW QUERY: It took 320.000000 ms to retrieve 90 items.
Jul 23, 2025 11:26:17.244 [140075284433720] WARN - [Req#e588] SLOW QUERY: It took 290.000000 ms to retrieve 90 items.
Jul 23, 2025 11:26:17.299 [140075621407544] DEBUG - Completed: [192.168.50.194:63050] 200 GET /library/sections/1/all?sort=addedAt:desc&contentDirectoryID=1&pinnedContentDirectoryID=2%2C3%2C4%2C5%2C1%2C7%2C8%2C9%2C11%2C13 (10 live) #e588 TLS GZIP Page 0-89 149ms 40489 bytes (pipelined: 8)
Jul 23, 2025 11:26:17.303 [140075621407544] DEBUG - Completed: [192.168.50.194:63052] 200 GET /library/sections/5/all?sort=addedAt:desc&contentDirectoryID=5&pinnedContentDirectoryID=2%2C3%2C4%2C5%2C1%2C7%2C8%2C9%2C11%2C13 (10 live) #e593 TLS GZIP Page 0-89 155ms 39607 bytes (pipelined: 9)
Jul 23, 2025 11:26:17.304 [140075621407544] DEBUG - Completed: [192.168.50.194:63054] 200 GET /library/sections/8/all?sort=addedAt:desc&contentDirectoryID=8&pinnedContentDirectoryID=2%2C3%2C4%2C5%2C1%2C7%2C8%2C9%2C11%2C13 (10 live) #e586 TLS GZIP Page 0-89 154ms 41077 bytes (pipelined: 6)
Jul 23, 2025 11:26:17.521 [140075371297592] DEBUG - Updating deletion state for metadata item 5189, is has a dead item count of 0.
Jul 23, 2025 11:26:17.521 [140075371297592] DEBUG - Deleting media item 465547.
Jul 23, 2025 11:26:17.808 [140075371297592] DEBUG - Was connected to metadata item 5189, count is now 442354.
Jul 23, 2025 11:26:19.390 [140075371297592] WARN - Held transaction for too long (/home/runner/_work/plex-media-server/plex-media-server/Library/MediaItem.cpp:885): 3.730000 seconds
Jul 23, 2025 11:26:19.963 [140075371297592] DEBUG - Updating deletion state for metadata item 5189, is has a dead item count of 0.
Jul 23, 2025 11:26:19.963 [140075371297592] DEBUG - Deleting media item 465548.
Jul 23, 2025 11:26:20.290 [140075371297592] DEBUG - Was connected to metadata item 5189, count is now 442353.
Jul 23, 2025 11:26:21.886 [140075371297592] WARN - Held transaction for too long (/home/runner/_work/plex-media-server/plex-media-server/Library/MediaItem.cpp:885): 3.820000 seconds
Jul 23, 2025 11:26:22.450 [140075371297592] DEBUG - Updating deletion state for metadata item 5189, is has a dead item count of 0.
Jul 23, 2025 11:26:22.450 [140075371297592] DEBUG - Deleting media item 465549.
Jul 23, 2025 11:26:22.745 [140075371297592] DEBUG - Was connected to metadata item 5189, count is now 442352.
Jul 23, 2025 11:26:24.320 [140075371297592] WARN - Held transaction for too long (/home/runner/_work/plex-media-server/plex-media-server/Library/MediaItem.cpp:885): 3.730000 seconds
Jul 23, 2025 11:26:24.887 [140075371297592] DEBUG - Updating deletion state for metadata item 5189, is has a dead item count of 0.
Jul 23, 2025 11:26:24.887 [140075371297592] DEBUG - Deleting media item 465550.
Jul 23, 2025 11:26:25.187 [140075371297592] DEBUG - Was connected to metadata item 5189, count is now 442351.
Jul 23, 2025 11:26:26.772 [140075371297592] WARN - Held transaction for too long (/home/runner/_work/plex-media-server/plex-media-server/Library/MediaItem.cpp:885): 3.760000 seconds
Jul 23, 2025 11:26:27.343 [140075371297592] DEBUG - Updating deletion state for metadata item 5189, is has a dead item count of 0.
Jul 23, 2025 11:26:27.343 [140075371297592] DEBUG - Deleting media item 465551.
Jul 23, 2025 11:26:27.661 [140075371297592] DEBUG - Was connected to metadata item 5189, count is now 442350.
Jul 23, 2025 11:26:29.248 [140075371297592] WARN - Held transaction for too long (/home/runner/_work/plex-media-server/plex-media-server/Library/MediaItem.cpp:885): 3.790000 seconds
Jul 23, 2025 11:26:29.811 [140075371297592] DEBUG - Updating deletion state for metadata item 5189, is has a dead item count of 0.
Jul 23, 2025 11:26:29.811 [140075371297592] DEBUG - Deleting media item 465552.
Jul 23, 2025 11:26:30.103 [140075371297592] DEBUG - Was connected to metadata item 5189, count is now 442349.
Jul 23, 2025 11:26:31.690 [140075371297592] WARN - Held transaction for too long (/home/runner/_work/plex-media-server/plex-media-server/Library/MediaItem.cpp:885): 3.740000 seconds
Jul 23, 2025 11:26:32.256 [140075371297592] DEBUG - Updating deletion state for metadata item 5189, is has a dead item count of 0.
Jul 23, 2025 11:26:32.256 [140075371297592] DEBUG - Deleting media item 465553.
Jul 23, 2025 11:26:32.552 [140075371297592] DEBUG - Was connected to metadata item 5189, count is now 442348.
Jul 23, 2025 11:26:34.144 [140075371297592] WARN - Held transaction for too long (/home/runner/_work/plex-media-server/plex-media-server/Library/MediaItem.cpp:885): 3.770000 seconds
Jul 23, 2025 11:26:34.716 [140075371297592] DEBUG - Updating deletion state for metadata item 5189, is has a dead item count of 0.
Jul 23, 2025 11:26:34.716 [140075371297592] DEBUG - Deleting media item 465554.
It might just be the DB is very badly fragmented.
How big are the DB’s (as seen in FileStation) ?