Jan 28, 2019 17:59:48.032 [13520] WARN - SLOW QUERY: It took 828.125000 ms to retrieve 0 items.
Jan 28, 2019 17:59:48.927 [12872] WARN - SLOW QUERY: It took 781.250000 ms to retrieve 0 items.
Jan 28, 2019 17:59:49.684 [11548] WARN - SLOW QUERY: It took 734.375000 ms to retrieve 0 items.
Jan 28, 2019 17:59:50.403 [13520] WARN - SLOW QUERY: It took 859.375000 ms to retrieve 0 items.
Jan 28, 2019 17:59:51.153 [12872] WARN - SLOW QUERY: It took 1046.875000 ms to retrieve 0 items.
Notice that 0 results are being returned. I have two questions.
What can I do to prevent this message from occurring? This never used to happen and I’ve been running on this same machine for years. I tried to speed things up by moving my Plex folder to an SSD but it literally made no difference in the warnings (though things seem faster when I am loading views)
What is making the query and getting 0 results? Is this some sort of Plex indexing service or something? Any way for me to determine what is making these queries and what the queries might be?
The 0 items reported in the log simply means that, for some reason, the query timed out before getting any items. The timings you’re reporting are in the (roughly) 0.7 to 1 second mark, which, these days, is a long time for a computer to obtain a response.
Are these logs being generated on the server system or on a remote access system?
If remote access, what is your remote connection rate?
If server, I’m already stumped.
Other posts I’ve seen WRT Slow Query mention a fragmented database.
The fix seems to be:
Stop all Scanning
Optimize database
Rescan ONE library section at a time until all have caught back up
Optimize database between each library section scan
Here’s a post from the Synology section. The OP was having trouble transcoding TrueHD audio, and also had many Slow Query entries in the log. Some of the discussion (iNotify) seems Linux specific, but the rest would apply to any platform.
That is most likely the issue. Each item indexed, regardless what it is, requires an Index number in the Plex DB. When PMS’s database was created, 5000 items was a lot. It’s improved a great deal.
An AMD FX-6300 6 core (fine CPU) has 6000 Passmarks. That’s more than most domestic NAS Boxes. Those NAS boxes run Linux. I know of no Windows-based NAS boxes.
There is no physical limit but there is a measurable limit of how many items the SQLITE interface library can return in 250ms on even the fastest of processors.
I borked the NAS (locked the UI and had to power cycle).
This is what I get for holding my finger too close to the left mouse button while zipping from side to side.
It is conducting a mandatory sync of the volume.
When that completes, I will run my rsync cross-comparison to make certain no files are damaged (QNAP v Synology).
58082 music tracks indexed. Time to retrieve all records on i7-7700 @ 3.6 Ghz = 23.1 ms
Extrapolating to the 250ms marker yields 628,593 music tracks per Library section.
Please note the distinction here. Per Library section.
The entire server now has 116,164 tracks indexed (from two other libraries). There is no observable degradation nor any abnormalities reported in the log files.
Host details:
i7-7700 @3.6 Ghz (64-bit)
32 GB RAM
Plex metadata and database - Samsung 860 EVO SSD
OS: QTS 4.3.6.0806 (Linux 4.2.8 kernel)
A consideration. If on a 32 bit OS, a significant portion of the hardware’s capabilities are being wasted to clock cycles. Nearly 2x as much data can be retrieved in the same amount of time. (the speedup is in excess of 2/3 improvment for most operations in PMS)
I migrated the Plex data from the SATA-3 (2.5" Samsung SSD) to the main QTS M.2 RAID pair.
Being a mirror, write performance is unchanged since both are written as a mirror.
Read performance, as expected, is 2x performance over a single SSD because a mirror RAID performed striped reading . This yields 1+ GB/sec read speed