[1452] Tagging performance - Improved SQL Query [#8626]

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: [1452] Tagging performance - Improved SQL Query [#8626]

Re: [1452] Tagging performance - Improved SQL Query

by jiri » Fri Nov 04, 2011 4:02 am

Hi, added the first issue to be reviewed as http://www.ventismedia.com/mantis/view.php?id=8626.

Thanks,
Jiri

[1452] Tagging performance - Improved SQL Query [#8626]

by toof4st » Thu Nov 03, 2011 5:32 pm

I have been looking at the debug log when I am tagging, via drag drop (onto a MagicNode)
I see this statement multiple times:
[6020] 6224 DB open SQL: SELECT NULL FROM Songs WHERE Songs.IDFolder in (SELECT IDChildFolder FROM FoldersHier WHERE IDFolder=3) LIMIT 1
[6020] 6224 DB lock finished, took 16296.

This would be about 10 times quicker (run using SQLViewer):
[6020] 6224 DB open SQL: SELECT NULL FROM Songs s INNER JOIN FoldersHier fh ON s.IDFolder = fh.IDChildFolder WHERE fh.IDFolder=3 LIMIT 1
[6020] 6224 DB lock finished, took 1251.

I know it won't solve the slow tagging, but every little but helps.

I would also question, why it is running the same query over and over.

I also see a huge number of these statements:
[6020] 6224 DB open SQL: SELECT ID,TrackCount FROM Folders WHERE IDMedia=? AND IDParentFolder=? AND Folder=?
[6020] 6224 DB lock finished, took 51.

Just wonder what these are all doing. Wonder if they are all required (obviously I don't know what the ? are, so can't tell if they are duplicates)

Top