View Issue Details

IDProjectCategoryView StatusLast Update
0005316MMW v4Playlist / Searchpublic2009-03-05 01:28
ReporterLudek Assigned To 
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.1 
Fixed in Version3.1 
Summary0005316: Limited Auto-playlists (restricted to X tracks or MBs or minutes) can be slow for some operations
DescriptionProblem is analyzed here: http://www.mediamonkey.com/forum/viewtopic.php?f=6&t=37262&st=0&sk=t&sd=a&start=15

One auto-playlist with Rating<0, Staus is not podcast, Path contains ":\Media\" or "\Music\", Genre doesn't contain "Spoken Word" or "Xmas", this one takes more than 2 seconds on DB with 27477 tracks when performing Find more from same -> Playlist operation.
The reason is that this auto-playlist is limited somehow (number of tracks ?, megabytes ?, minutes ?) and therefore we perform full query and get X tracks from DB and then determine whether the track belongs to this subset. We do so because everytime you use an auto-playlist that is somehow limited (e.g. to 500 tracks) then criteria based on sort order (date added in this case) could change and therefore we get all the current 500 tracks from DB.

Possibilities to improve performance of this are:

1. Instead of getting all the tracks from DB and then putting them back by pre-filling PlaylistSongs table and then performing a query as for regular playlist we could improve this by using e.g. 'HAVING SUM(SongLength) < X' SQL clause or something like that.

2. As the user suggested: would be great if MM was able to expand the "more from same / playlist" menu even if it hasn't finished populating it - that way it wouldn't freeze up MM at all for anyone and longer playlists would just appear in the menu once they could.

TagsNo tags attached.
Fixed in build1225

Relationships

parent of 0005393 closedLudek Advanced search: condition 'Playlist is' is broken when referenced playlists are limited to number of tracks (regression) 

Activities

Ludek

2009-02-19 14:25

developer   ~0016675

Last edited: 2009-02-23 21:42

I am not sure about 1.
i.e. using the 'HAVING SUM(SongLength) < X' could on the other hand slow down filling tracklist by tracks from such auto-playlist. Not sure, this probably needs to be tested. The best way seems to be to use 'HAVING SUM(SongLength) < X' only for operations like this (find more from same playlist and for the List of playlists to which a song belongs in Song Properties - Classification tab).

Ludek

2009-02-24 19:11

developer   ~0016940

Last edited: 2009-02-24 19:14

Re 1: SUM() is not acceptable when used in conjunction with HAVING or WHERE, so there is a problem with this for "megabytes" and "minutes" restrictions/limitations.

But in case of limitations for number of tracks there can be used LIMIT clause and this speeds up things a lot.

So for MM 3.1 I fixed (improved performance) at least limitations with regard to number of tracks.
The performance is improved in build 1225.

stephen_platt

2009-03-05 01:28

developer   ~0016996

verified 1225 no regressions introduced