Why is search so slow on plexweb?

This is one thing that has always been a bit of a gripe, and it has been even more of one since the changes to the “instant search”.

Why does plex web take so long to search for results? especially when the “instant search” at the start of this video has results in like 2-3 seconds…

Just ran a database optimisation to see if this fixes these search speeds.

Get this in the log files

!
! Optimizing database. Starting by capturing all sessions.
! Apr 12, 2016 09:06:08:229 [11228] DEBUG - Captured session 0.
! Apr 12, 2016 09:06:08:229 [11228] DEBUG - Captured session 1.
! Apr 12, 2016 09:06:08:229 [11228] DEBUG - Captured session 2.
! Apr 12, 2016 09:06:08:229 [11228] DEBUG - Captured session 3.
! Apr 12, 2016 09:06:08:229 [11228] DEBUG - Captured session 4.
! Apr 12, 2016 09:06:08:230 [11228] DEBUG - Captured session 5.
! Apr 12, 2016 09:06:08:230 [11228] DEBUG - Captured session 6.
! Apr 12, 2016 09:06:08:230 [11228] DEBUG - Captured session 7.
! Apr 12, 2016 09:06:08:230 [11228] DEBUG - Captured session 8.
! Apr 12, 2016 09:06:08:230 [11228] DEBUG - Captured session 9.
! Apr 12, 2016 09:06:08:230 [11228] DEBUG - Captured session 10.
! Apr 12, 2016 09:06:08:230 [11228] DEBUG - Captured session 11.
! Apr 12, 2016 09:06:08:230 [11228] DEBUG - Captured session 12.
! Apr 12, 2016 09:06:08:230 [11228] DEBUG - Captured session 13.
! Apr 12, 2016 09:06:08:230 [11228] DEBUG - Captured session 14.
! Apr 12, 2016 09:06:08:231 [11228] DEBUG - Captured session 15.
! Apr 12, 2016 09:06:08:231 [11228] DEBUG - Captured session 16.
! Apr 12, 2016 09:06:08:231 [11228] DEBUG - Captured session 17.
! Apr 12, 2016 09:06:08:231 [11228] DEBUG - Captured session 18.
! Apr 12, 2016 09:06:08:231 [11228] DEBUG - Captured session 19.
! Apr 12, 2016 09:06:08:231 [11228] DEBUG - Database optimization: Rebuilding full text search tables.
! Apr 12, 2016 09:06:17:492 [11228] WARN - Held transaction for too long (Library\FullTextSearch.cpp:16): 9.250859 seconds
! Apr 12, 2016 09:06:17:767 [12168] DEBUG - Request: [192.168.0.3:53051] GET /library/recentlyAdded?X-Plex-Container-Start=0&X-Plex-Container-Size=10&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx (6 live)
! Apr 12, 2016 09:06:17:767 [12168] DEBUG - Auth: We found auth token (xxxxxxxxxxxxxxxxxxxx), enabling token-based authentication.
! Apr 12, 2016 09:06:17:767 [12168] DEBUG - Auth: Came in with a super-token, authorization succeeded.
! Apr 12, 2016 09:06:20:781 [11228] WARN - Held transaction for too long (Library\FullTextSearch.cpp:26): 2.995219 seconds
! Apr 12, 2016 09:06:24:662 [11228] WARN - Held transaction for too long (Library\FullTextSearch.cpp:35): 3.822024 seconds
! Apr 12, 2016 09:06:26:607 [11228] WARN - Held transaction for too long (Library\FullTextSearch.cpp:45): 1.887612 seconds
! Apr 12, 2016 09:06:26:630 [11228] DEBUG - Database optimization: starting.
! Apr 12, 2016 09:06:37:794 [13964] DEBUG - Request: [192.168.0.3:53105] GET /status/sessions?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx (6 live)
! Apr 12, 2016 09:06:37:795 [13964] DEBUG - Auth: We found auth token (xxxxxxxxxxxxxxxxxxxx), enabling token-based authentication.
! Apr 12, 2016 09:06:37:795 [13964] DEBUG - Auth: Came in with a super-token, authorization succeeded.
! Apr 12, 2016 09:06:57:843 [9796] DEBUG - Request: [192.168.0.3:53132] GET /library/recentlyAdded?X-Plex-Container-Start=0&X-Plex-Container-Size=10&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx (7 live)
! Apr 12, 2016 09:06:57:843 [9796] DEBUG - Auth: We found auth token (xxxxxxxxxxxxxxxxxxxx), enabling token-based authentication.
! Apr 12, 2016 09:06:57:844 [9796] DEBUG - Auth: Came in with a super-token, authorization succeeded.
! Apr 12, 2016 09:07:13:208 [11228] DEBUG - Database optimization: complete.

It is these Held transation for too long warnings that have me worried - is it just giving up on rebuilding the full text search tables?

There are also these lines after the database optimisation that have me worried.

! Apr 12, 2016 09:07:13:221 [11228] INFO - SQLITE3:07E42835, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
! Apr 12, 2016 09:07:13:229 [11228] INFO - SQLITE3:07E42835, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
! Apr 12, 2016 09:07:13:230 [11228] INFO - SQLITE3:07E42835, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
! Apr 12, 2016 09:07:13:247 [11228] INFO - SQLITE3:07E42835, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed

I have attached the full server log - all that has happened in this log file is server start, and 3-4 optimisation actions.

When database optimisation used to finish we were alerted in plex web werent we?

Sounds like you might have a corrupted database. Try following the instructions in this article to fix the problem. https://support.plex.tv/hc/en-us/articles/201100678-Repair-a-Corrupt-Database

Let me know if you need help.

@MovieFan.Plex - I dont care what others say about you, you are the man!

Huh, what do people say about me?

haha, it’s a saying here in America, it’s meant for affection

@rzdcffs not just America :slight_smile:

@MovieFan.Plex said:
Huh, what do people say about me?

…all nice things, honest!

I am in America and I’ve never heard that saying to be good. :((

Edit - Thanks for the compliment. :))