MySQL: Inefficient queries? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +--- Thread: MySQL: Inefficient queries? (/showthread.php?tid=134271) |
MySQL: Inefficient queries? - salnajjar - 2012-06-18 I've been using the MySQL functionality of XBMC for a while and after trying a number of things I've noticed that bringing up the Artists list in the Music section is extremely slow so today I decided to do some troubleshooting. To give an idea of performance, my database is: 722 Artists 12806 Tracks 953 Albums A "select *" for any of the individual tables takes less than 0.25 seconds. Going into any of the other XBMC menus (Songs, Albums, Shows, Videos, etc) is pretty snappy, but, going into Artists takes about 7 seconds. I put a trace on MySQL and found the following happened for the Artists query: Code: 758 Connect [email protected] on It seems that XBMC performs a recursive query against the "artistinfo" table for each of the artist ID's returned by the artist search and this is where the delay is coming from. Is there any way to stop XBMC from querying the artistinfo as an option in advancedsettings? Or having it perform the query on the fly is someone stays on an artist for longer than a second? Thanks for any pointers or help. RE: MySQL: Inefficient queries? - jmarshall - 2012-06-19 Your best bet is joining the tables in the initial query. There's no particularly reason why it can't be joined directly that I can see - you still have a 1:1 mapping involved. You'd need to update the way the info is fetched - see GetArtistsByWhere() in MusicDatabase.cpp. Cheers, Jonathan RE: MySQL: Inefficient queries? - night199uk - 2012-06-19 This is fixed in the MusicDatabase fixes in Pull Request #1090. This is the commit, you might be able to back port it if you felt so inclined. It wouldn't be a lot of work to port just this commit into master. https://github.com/night199uk/xbmc/commit/15b537237a16cf1a2902a1d569fd4b27b7925729 |