diff options
author | Dave Blake <oak99sky@yahoo.co.uk> | 2019-01-20 23:15:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-20 23:15:38 +0000 |
commit | fb81990d237648e023090862ee665a41e439db5d (patch) | |
tree | f6adedd7b7fba7f35a57768762fb80bc15cd2e45 | |
parent | 3aac935a7e712e7a303763c649351d1569241cae (diff) | |
parent | 5edab9e558c1437f7c663a07d938e60c1056391f (diff) |
Merge pull request #15284 from DaveTBlake/PartymodeMySQLfast
Fix party mode slowness on MySQL
-rw-r--r-- | xbmc/music/MusicDatabase.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp index b609bdbc65..71b35812ed 100644 --- a/xbmc/music/MusicDatabase.cpp +++ b/xbmc/music/MusicDatabase.cpp @@ -1376,7 +1376,20 @@ bool CMusicDatabase::GetArtist(int idArtist, CArtist &artist, bool fetchAll /* = if (fetchAll) strSQL = PrepareSQL("SELECT * FROM artistview LEFT JOIN discography ON artistview.idArtist = discography.idArtist WHERE artistview.idArtist = %i", idArtist); else - strSQL = PrepareSQL("SELECT * FROM artistview WHERE artistview.idArtist = %i", idArtist); + // Same fields as artistview, but don't fetch dateadded when value not + // needed. MySQL very slow for view with subquery column with aggregate + //! @todo replace with artistview once dateadded is column of artist table + strSQL = PrepareSQL("SELECT " + "idArtist, strArtist, strSortName, " + "strMusicBrainzArtistID, " + "strType, strGender, strDisambiguation, " + "strBorn, strFormed, strGenres," + "strMoods, strStyles, strInstruments, " + "strBiography, strDied, strDisbanded, " + "strYearsActive, strImage, strFanart, " + "bScrapedMBID, lastScraped, " + "'' AS dateAdded " + "FROM artist WHERE idArtist = %i", idArtist); if (!m_pDS->query(strSQL)) return false; if (m_pDS->num_rows() == 0) |