View Issue Details

IDProjectCategoryView StatusLast Update
0011465MMW v4Framework: Scripts/Extensionspublic2013-11-08 15:03
Reporterzvezdan Assigned To 
PrioritynoneSeverityminorReproducibilityalways
Status newResolutionopen 
Summary0011465: ISDBDatabase::GetAutoPlaylistQuery is very slow for some built-in auto-playlists
DescriptionI understand that getting files using some SQL query could take some time, but getting some simple SQL code should not be so slow.

1. Favorites - 1 Audio CD Worth (74 min) - 0.578 sec
SELECT Songs.*
FROM Songs WHERE ( Songs.Id IN (SELECT PlaylistSongs.IdSong FROM PlaylistSongs WHERE PlaylistSongs.IdPlaylist IN ( 4) ) )

2. Favorites - 1 MP3 CD Worth (650 MB) - 1.531 sec
SELECT Songs.*
FROM Songs WHERE ( Songs.Id IN (SELECT PlaylistSongs.IdSong FROM PlaylistSongs WHERE PlaylistSongs.IdPlaylist IN ( 5) ) )

3. Favorites - Not Heard Recently (1 hr) - 0.546 sec
SELECT Songs.*
FROM Songs WHERE ( Songs.Id IN (SELECT PlaylistSongs.IdSong FROM PlaylistSongs WHERE PlaylistSongs.IdPlaylist IN ( 6) ) )

Maybe 0.5 - 1.5 seconds doesn't look too slow, but when I want to construct SQL code for all auto-playlists in my database using some loop to be able to find which tracks are contained in them, it takes 4 seconds just for GetAutoPlaylistQuery.

However, after I construct my SQL code, its execution takes just about 0.5 seconds, which is illogical since queries through the database usually lasts longer than the construction of SQL code for those queries.

I would like to know why your program takes 0.5 - 1.5 seconds to return such simple queries like those 3 mentioned ones.

Interestingly enough, getting query for the built-in playlist Favorites - Top 50 lasts only 0.015 seconds:
SELECT Songs.*
FROM Songs WHERE ( Songs.Id IN (SELECT Songs.Id
FROM Songs WHERE Songs.PlayCounter + (Songs.PlaybackPos * 1.0 / Songs.SongLength)>0 ORDER BY Songs.PlayCounter DESC, Songs.LastTimePlayed LIMIT 50) )
TagsNo tags attached.
Fixed in build

Activities

There are no notes attached to this issue.