Jump to content

Search Very Slow (3 minute response)


Recommended Posts

Rumzzz
Posted

@Lukeplease tell me this is close to being fixed for testing 🥺

  • Agree 2
blinky
Posted

Really hope a fix is coming soon, it's making things really frustrating when users search and it just locks up and affects everyone else. Having to disable search is kind of a really big negative.

 

As much as I like and prefer emby and have no issue paying a monthly premier fee, there will come a time/limit of patience before I start moving users over to jellyfin or something else where search actually works, I can't be the only one this frustrates so much.

  • Agree 4
Napsterbater
Posted
On 7/9/2026 at 3:37 PM, Rumzzz said:

@Lukeplease tell me this is close to being fixed for testing 🥺

Best they can do is

On 5/10/2026 at 1:41 PM, Luke said:

Hi, we are looking into improving this. Thanks.

🙄

 

Posted

Must be an old issue, since I have a folder with 23000 porn videos and when I search for a porn name the videos start appearing in less than a second. I was always amazed on how fast searches are in Emby.

Posted (edited)
1 hour ago, Lutzif3r said:

Must be an old issue, since I have a folder with 23000 porn videos and when I search for a porn name the videos start appearing in less than a second. I was always amazed on how fast searches are in Emby.

How large is the entire library and is your search being done globally?

I am guessing your comment is from a different point of view. You aren't holding hundreds of thousands and possibly millions of different items in different music, photo, and video libraries. Not to mention the actors in those, the studios, the genres, the everything.

Having a meager collection of 23,000 things is different than millions of things. What is the size of your library.db? I am suspecting it isn't anywhere near 4GB. Once it gets a certain size the search is problematic.

Edited by speechles
  • Agree 2
Posted (edited)

Ok then, I guess I actually have way more, cause I was only counting that one folder although the search is obviously scanning my music folder and my music video folder also. I don't have movies though.

I guess my library db isn't near 4 gigs, is only 3 gigs.

Edited by Lutzif3r
Posted
10 hours ago, speechles said:

Having a meager collection of 23,000 things is different than millions of things.

You must have some serious storage space, my video collection is only taking up 20 TB.

Aberr89
Posted

Hello all,

I assisted a friend of mine who was having what I believe to be the same issues as this one.
When he would do any type of search on any platform that has multiple words it would take 10+ seconds.
Using the quotations helped; but, you cannot do this with the voice input for the TV app.
I had him enable debug logging and I reviewed the embyserver.txt log file.
I saw SQL queries that matched the time spend on the search. Along with neighboring lines including the search terms.
When searching with just a single word, the queries in the log file looked different that the multi-word queries.
I thought that maybe the Emby server was interpreting these words as tags and aggressively checking the database.
This still may be the case with a single word; but, I do not have any experience with Emby to know for sure.
I used DB Browser for SQLite to run this query manually on the library.db to isolate the issue to the database and not the Client/Server.
The queries in the log file use the alias @SearchTerm instead of the actual search terms. I replaced @SearchTerm in the query with the search string/term (in quotes) used on the Client end.
Example: 'wall street' for the movie "The Wolf of Wall Street".
Once confirmed that the slowness was isolated to the DB, I checked for the existence of indexes in the database. See query below.
After reviewing the indexes in the database and the queries found in the server log, I decided to create two new indexes.
Before making any changes to the database we backed up the server and shut it down.
Using DB Browser for SQLite, I ran the below commands to add the new indexes to the database. I wrote the changes and close the database when done.
This seemed to improve performance 3 to 10 time over previous examples.

Please feel free to give this a try yourself.
Do not attempt this if any of this does not make sense.

In theory this should not affect the Emby server at all; but, I cannot confirm that.
I also cannot confirm that any updates to the Emby server will not change this back, or cause any conflicts with any future updates.

I hope this is of some assistance.

I am not going to be monitoring this post.

 

Review of indexes:

SELECT
    name,
    tbl_name,
    sql
FROM
    sqlite_master
WHERE
    type = 'index'
ORDER BY
    tbl_name,
    name;

 

Index one:

CREATE INDEX IF NOT EXISTS idxItemLinks2_ItemId_Type_LinkedId
ON ItemLinks2 (ItemId, Type, LinkedId);

 

Index two:

CREATE INDEX IF NOT EXISTS idxAncestorIds2_ItemId_Distance_AncestorId
ON AncestorIds2 (ItemId, Distance, AncestorId);

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...