View Issue Details

IDProjectCategoryView StatusLast Update
0008626MMW v4Otherpublic2011-11-04 09:03
Reporterjiri Assigned To 
PriorityhighSeverityminorReproducibilityhave not tried
Status assignedResolutionopen 
Product Version4.0 
Target Version4.1 
Summary0008626: Optimize some SQL queries
DescriptionAs reported in http://www.mediamonkey.com/forum/viewtopic.php?f=6&t=61584 we run very often queries like

SELECT NULL FROM Songs WHERE Songs.IDFolder in (SELECT IDChildFolder FROM FoldersHier WHERE IDFolder=3)

form AddSystemFolder().

We should:
1. Review whether the query isn't called unnecessarily.
2. Test whether it can be rewritten in the form suggested by user in the forum (it might be faster, but it might depend on filter used and DB size).
3. Pre-compile the query, so that its execution is faster.


As for the second issue mentioned, usage of

SELECT ID,TrackCount FROM Folders WHERE IDMedia=? AND IDParentFolder=? AND Folder=?

seems to be correct and optimized, but we should review whether GetFolderIDOfPath() isn't sometimes called unnecessarily.
TagsNo tags attached.
Fixed in build

Activities

There are no notes attached to this issue.