2015-04-07, 22:31
Hello!
When pressing an artist in kodi to view albums, this is the sql query kodi uses.
3 rows in set (2.70 sec)
I played around a bit, and came to this.
(1.06 sec)
if you only check album_artist.idArtist with the later queryits down to 0.02s.
So far ive tried about 30 artists I have and get the same results so far, any input? is this useable?
When pressing an artist in kodi to view albums, this is the sql query kodi uses.
Code:
SELECT albumview.* FROM albumview JOIN song ON song.idAlbum = albumview.idAlbum JOIN song_artist ON song.idSong = song_artist.idSong JOIN album_artist ON albumview.idAlbum = album_artist.idAlbum WHERE song_artist.idArtist = 1919 OR album_artist.idArtist = 1919 GROUP BY albumview.idAlbum
3 rows in set (2.70 sec)
I played around a bit, and came to this.
Code:
select album.idAlbum, album.strAlbum, album.strMusicBrainzAlbumID, album.strArtists, album.strGenres, album.iYear, album.strMoods, album.strStyles, album.strThemes, album.strReview, album.strLabel, album.strType, album.strImage, album.iRating, album.bCompilation, MIN(song.iTimesPlayed)
FROM album JOIN song ON song.idAlbum = album.idAlbum JOIN album_artist ON album.idAlbum = album_artist.idAlbum JOIN song_artist ON song.idSong = song_artist.idSong where song_artist.idArtist = 1919 OR album_artist.idArtist = 1919 GROUP BY album.idAlbum;
(1.06 sec)
if you only check album_artist.idArtist with the later queryits down to 0.02s.
So far ive tried about 30 artists I have and get the same results so far, any input? is this useable?