Slow smart filter query

Hi tolriq,

I’ll continue this topic, because I’m experiencing the same issue on Navidrome.

A fresh install of Symfonium 5.9.0, then connect to my server via https (I also have a hosted domain). Loading occurs, I created a smart playlist with “Favourite Artists” and then view the playlist, which takes over 120 seconds.

I then choose “Shuffle”, “Preparing your medias (sic?), please wait” is displayed but never plays.

This used to work perfectly in the past.

Logs attached.
debug-20231011_110422.zip (2.5 KB)

Your issue is completely unrelated …

There’s not much in the logs except a very very very slow query

2023-10-11 11:02:03.038 T:QueryBuilder
Query: SELECT songs._id,songs.thumbnail,songs.title,songs.display_artist,songs.duration,songs.offline_status,songs.external_id,songs.provider_id,CASE WHEN songs.thumbnail IS NULL THEN albums.thumbnail ELSE songs.thumbnail END,albums.title,songs.file,songs.external_data,songs.is_favorite,songs.play_count,songs.rating,songs.user_rating FROM songs LEFT JOIN albums ON (songs.album_id=albums._id) WHERE ((EXISTS (SELECT 1 FROM songs_artists, artists WHERE songs_artists.artist_id = artists._id AND songs_artists.song_id = songs._id AND artists.is_favorite>0))) (‘’) [278 in 118648.52ms]

Can you show exactly how you created your smart playlist ?
How many songs / albums do you have ?

To play favorites artists in random it’s preferred to go to the artist view with the favorite filter then press the mix button.

OK, thanks for creating a new topic.

What’s the best way to show you? A video?

4700 albums
50000 songs

Note that smart playlists worked for me previously.

Cheers

How many artists and how many favorited?

Your issue is specific to this smartplaylist and is probably caused by the query reaching some kind of limits that makes it ultra slow.

With more songs and albums but only 4 favorites artists it’s 30 ms.

2392 Artists
2 Favourite artists

IT makes no sense with a much larger library the exact same query takes 30 milli seconds on all my devices and 2 minutes on your device.

Can you provide logs when browsing the artist section then enabling the Only favorites files then pressing the mix button at the top to have comparative query numbers.

Hi Tolriq,

Done. Works perfectly. Log attached.

Ultimately I want a smart playlist with favourite artists, albums and songs.
debug-20231012_094042.zip (17.6 KB)

Cheers

Well yes everything is fast as expected I have no idea why that specific queries is slow on your device and was not before. It’s unchanged since the start.

I’ll change the query to a another variation that perform the same here on my devices but no idea how it will perform on your device.

Hi Tolriq,

Reinstalled 5.9.0 on a new Pixel 8 Pro and still the same slowness experienced.

Upgraded to 6.0.0B1 and the problem went away, which is a good (albeit confusing) result.

Cheers

Well no it’s normal that making changes leads to changes :wink:

What’s confusing is why I was not able to reproduce your issue with a much bigger library.

But since it works let’s call this a win.