# SLOW QUERY errors

**URL:** <https://forums.plex.tv/t/slow-query-errors/725292>\
**Category:** Plex Media Server\
**Tags:** server-docker, server-unraid\
**Created:** [June 28, 2021, 1:40pm UTC](https://forums.plex.tv/t/slow-query-errors/725292 "2021-06-28T13:40:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpuddyUK](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@SpuddyUK](https://forums.plex.tv/u/SpuddyUK)\
**Post date:** [June 28, 2021, 1:40pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/1 "2021-06-28T13:40:46Z")

</div>

Server Version#: 1.23.3.4707  
Player Version#: 1.33.0.2444-a220eae4

I’m seeing a whole load of SLOW QUERY errors in the [PMS logs.](https://support.plex.tv/articles/200250417-plex-media-server-log-files/) Media is on unRAID array, Plex Metadata/DB/Config is on a dedicated SATA SSD, not unRAID cache drive. Using official Plex container.

> Jun 28, 2021 14:36:12.934 [0x155133a6fb38] Warning — SLOW QUERY: It took 340.000000 ms to retrieve 20 items.  
> Jun 28, 2021 14:36:12.934 [0x155139418b38] Warning — SLOW QUERY: It took 260.000000 ms to retrieve 17 items.  
> Jun 28, 2021 14:36:12.938 [0x155133252b38] Warning — SLOW QUERY: It took 320.000000 ms to retrieve 20 items.  
> Jun 28, 2021 14:36:12.940 [0x155133a4cb38] Warning — SLOW QUERY: It took 210.000000 ms to retrieve 13 items.  
> Jun 28, 2021 14:36:12.948 [0x1551331efb38] Warning — SLOW QUERY: It took 270.000000 ms to retrieve 20 items.  
> Jun 28, 2021 14:36:13.012 [0x1551339d5b38] Warning — SLOW QUERY: It took 210.000000 ms to retrieve 22 items.  
> Jun 28, 2021 14:36:13.037 [0x1551334d3b38] Warning — SLOW QUERY: It took 260.000000 ms to retrieve 31 items.  
> Jun 28, 2021 14:36:13.126 [0x155133a4cb38] Warning — SLOW QUERY: It took 260.000000 ms to retrieve 49 items.

I have optimised DB and cleared bundles. I have used SQLite to export and reimport the DB as per [Repair a corrupted database](https://support.plex.tv/articles/repair-a-corrupted-database/), even though the intergrity check came back OK.

Any ideas?

---

<div class="post-metadata">

**Author:** ![SpuddyUK](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@SpuddyUK](https://forums.plex.tv/u/SpuddyUK)\
**Post date:** [June 29, 2021, 3:40pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/2 "2021-06-29T15:40:44Z")

</div>

bump. wondering if this is expected or an issue?

---

<div class="post-metadata">

**Author:** ![hthighway](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hthighway/32/82003_2.png) [@hthighway](https://forums.plex.tv/u/hthighway)\
**Post date:** [June 29, 2021, 4:40pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/3 "2021-06-29T16:40:13Z")

</div>

I have no solution of you, as I see the same behavior in any of the 1.23.x versions.

I see it less often in the 1.22.x versions though, so that’s where I stay for now

---

<div class="post-metadata">

**Author:** ![Atomatth](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/atomatth/32/314355_2.png) [@Atomatth](https://forums.plex.tv/u/Atomatth)\
**Post date:** [June 29, 2021, 7:10pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/4 "2021-06-29T19:10:24Z")

</div>

@SpuddyUK Can you please share the zip of your logs? Without seeing the entire picture it’s difficult to know what is happening.

---

<div class="post-metadata">

**Author:** ![SpuddyUK](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@SpuddyUK](https://forums.plex.tv/u/SpuddyUK)\
**Post date:** [June 30, 2021, 9:54am UTC](https://forums.plex.tv/t/slow-query-errors/725292/5 "2021-06-30T09:54:22Z")

</div>

@Atomatth shared in PM. Thanks!

---

<div class="post-metadata">

**Author:** ![Atomatth](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/atomatth/32/314355_2.png) [@Atomatth](https://forums.plex.tv/u/Atomatth)\
**Post date:** [July 1, 2021, 12:05pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/6 "2021-07-01T12:05:01Z")

</div>

I’m not seeing that error in any of your logs. Are you observing any issues or just noticed these entries in the logs?

---

<div class="post-metadata">

**Author:** ![SpuddyUK](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@SpuddyUK](https://forums.plex.tv/u/SpuddyUK)\
**Post date:** [July 1, 2021, 12:50pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/7 "2021-07-01T12:50:29Z")

</div>

@Atomatth No particular issues, I noticed the entries in the logs.

---

<div class="post-metadata">

**Author:** ![dom\_a2345](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dom\_a2345](https://forums.plex.tv/u/dom_a2345)\
**Post date:** [August 4, 2021, 10:50am UTC](https://forums.plex.tv/t/slow-query-errors/725292/8 "2021-08-04T10:50:22Z")

</div>

I have this exact issue and everyday i am restarting my plex server multiple times as it gets stuck when updating metadata for movies over night and will not complete the task with out restarting multiple times

---

<div class="post-metadata">

**Author:** ![Atomatth](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/atomatth/32/314355_2.png) [@Atomatth](https://forums.plex.tv/u/Atomatth)\
**Post date:** [August 5, 2021, 2:01am UTC](https://forums.plex.tv/t/slow-query-errors/725292/9 "2021-08-05T02:01:05Z")

</div>

Can you please share the zip of your logs? Without seeing the entire picture it’s difficult to know what is happening.

---

<div class="post-metadata">

**Author:** ![dom\_a2345](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dom\_a2345](https://forums.plex.tv/u/dom_a2345)\
**Post date:** [August 5, 2021, 8:30am UTC](https://forums.plex.tv/t/slow-query-errors/725292/10 "2021-08-05T08:30:59Z")

</div>

PM’d you my logs

---

<div class="post-metadata">

**Author:** ![Atomatth](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/atomatth/32/314355_2.png) [@Atomatth](https://forums.plex.tv/u/Atomatth)\
**Post date:** [August 5, 2021, 1:21pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/11 "2021-08-05T13:21:18Z")

</div>

You can try using the [Optimize Database](https://support.plex.tv/articles/226836308-help/#:~:text=The%20Optimize%20Database%20option%20cleans,for%20the%20server%20is%20complete.). You can also try deleting the container and readding it. Just make sure to point it back to the same appdata location.

---

<div class="post-metadata">

**Author:** ![dom\_a2345](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dom\_a2345](https://forums.plex.tv/u/dom_a2345)\
**Post date:** [August 5, 2021, 2:19pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/12 "2021-08-05T14:19:54Z")

</div>

i have optimized the database, i have removed the container and re-added it and then just for good measure re-optimized the db again. We will see how this goes and whether things improve.

---

<div class="post-metadata">

**Author:** ![Orko](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/orko/32/82522_2.png) [@Orko](https://forums.plex.tv/u/Orko)\
**Post date:** [August 5, 2021, 4:06pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/13 "2021-08-05T16:06:50Z")

</div>

```auto
# cat Plex\ Media\ Server.log |grep SLOW |wc -l
87

```

seems to be more widespread?

---

<div class="post-metadata">

**Author:** ![dom\_a2345](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dom\_a2345](https://forums.plex.tv/u/dom_a2345)\
**Post date:** [August 6, 2021, 9:20am UTC](https://forums.plex.tv/t/slow-query-errors/725292/14 "2021-08-06T09:20:49Z")

</div>

@Atomatth

This morning after scheduled tasks over night, it once again is stuck updating metadata. New logs will be dm’d to you.

---

<div class="post-metadata">

**Author:** ![jakehoms](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jakehoms](https://forums.plex.tv/u/jakehoms)\
**Post date:** [August 6, 2021, 11:01am UTC](https://forums.plex.tv/t/slow-query-errors/725292/15 "2021-08-06T11:01:36Z")

</div>

Been having the same issue as OP for easily over 2 weeks now. My media is on a Synology NAS (6.x, not the newer 7.0 DSM version) and made a post here which has my log files if it helps:

> [@Slow Query time - unable to scan or play media](https://forums.plex.tv/t/slow-query-time-unable-to-scan-or-play-media/733702):
>
> Hi folks. I have been seeing issues in Plex for about a week and a half. Issue: Spinning activity monitor in Plex Web + unable to scan my libraries and usually is so slow it doesn’t allow users to play media (internally or externally). Repeating issues in the Plex Media Scanner.log file: Aug 03, 2021 11:35:51.216 [0x7f86db445848] WARN - SLOW QUERY: It took 8040.000000 ms to retrieve 0 items. Aug 03, 2021 11:35:58.426 [0x7f86db445848] WARN - SLOW QUERY: It took 7200.000000 ms to retrieve 0 it…

---

<div class="post-metadata">

**Author:** ![telfordje](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@telfordje](https://forums.plex.tv/u/telfordje)\
**Post date:** [August 6, 2021, 5:51pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/16 "2021-08-06T17:51:15Z")

</div>

Just chiming in hoping the more of us complaining and the Plex dev team will take this problems seriously.

I’m trying to import my music library and Plex has been running for days now. I setup my library to only use local metadata and logs are full of slow queries.

If I use Airsonic/Madsonc it can scan my whole library in a little over an hour.

---

<div class="post-metadata">

**Author:** ![Atomatth](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/atomatth/32/314355_2.png) [@Atomatth](https://forums.plex.tv/u/Atomatth)\
**Post date:** [August 6, 2021, 6:45pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/17 "2021-08-06T18:45:46Z")

</div>

Can you please share your logs?

---

<div class="post-metadata">

**Author:** ![telfordje](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@telfordje](https://forums.plex.tv/u/telfordje)\
**Post date:** [August 6, 2021, 8:11pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/18 "2021-08-06T20:11:26Z")

</div>

[logs.zip](https://forums.plex.tv/uploads/short-url/gPBPy6ZrLOFusJuBJamlKSxPijc.zip) (3.1 MB)

Here are a zip of all my logs.

---

<div class="post-metadata">

**Author:** ![jakehoms](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@jakehoms](https://forums.plex.tv/u/jakehoms)\
**Post date:** [August 11, 2021, 10:20pm UTC](https://forums.plex.tv/t/slow-query-errors/725292/19 "2021-08-11T22:20:28Z")

</div>

HI Atomatth. Here are my older + current logs (timestamped):

[Plex Media Server Logs\_2021-08-03\_11-20-33.zip](https://forums.plex.tv/uploads/short-url/59zrAsBuBJefsOHH9Lg5NFaR3KY.zip) (4.5 MB)

[Plex Media Server Logs\_2021-08-05\_20-20-26.zip](https://forums.plex.tv/uploads/short-url/ixMfLKDpy9dd8jjHQLcZr8ogqmv.zip) (4.2 MB)

[Plex Media Server Logs\_2021-08-11\_15-21-05.zip](https://forums.plex.tv/uploads/short-url/oy9Ky13pr8jm2AyESZfmytumHMU.zip) (4.6 MB)

This continues to be a wide-spread issue, and restarting doesn’t help for long.

- Scanning doesn’t work reliably at all from the GUI
- Users report shows fail to start (guessing due to high CPU contention for the scanner activity ongoing)

Load is consistently over 3.0 with the Plex Transcoder and/or Plex Media Scanner well over 100%.

---

<div class="post-metadata">

**Author:** ![xxrazorxx](https://avatars.discourse-cdn.com/v4/letter/x/c57346/32.png) [@xxrazorxx](https://forums.plex.tv/u/xxrazorxx)\
**Post date:** [August 25, 2021, 1:11am UTC](https://forums.plex.tv/t/slow-query-errors/725292/20 "2021-08-25T01:11:20Z")

</div>

I’m seeing the same issue a lot: Slow Query took xxx. On top of this issue, I’m seeing that many of my remote connections will simply say: `An error occurred while attempting to play this video. Please check your connection and try again` This never happened before and it’s happening on Nvidia shield and firetv devices. This started happening about 1-2 weeks ago. I have tried to optimize the database, clean the bundles, empty trash.

The server is running on UnRaid, Docker + NVidia P2000 for transcoding. Dedicated NVME SSD for the plex DB. [Plex Media Server Logs\_2021-08-24\_21-07-41.zip](https://forums.plex.tv/uploads/short-url/oxdyOgiCQY57hH5Pw11U7whrSQb.zip) (5.3 MB)

[Next page](https://forums.plex.tv/t/slow-query-errors/725292.md?page=2)
