Solved Issue with MySQL & large music libraries resulting in duplicate artists
#12
OK, very useful data @hpcertpro  thank you. I can see the records in part1 are not in id order, hence the next chunck could well return duplicates. However it looks like you have accidentally duplicated the part3 JSON file as part2. I'm sure you have the part2 as you describe ({"end":1500,"start":750}) but it would be nice to have it too for completeness. Just the 17.6 file is all I need.
 
Quote:Could this help as a fix:  when a table segment is requested (as opposed to the entire table), would it be possible for Kodi to do some kind of SORT of the table before splitting it into chunks. That would guarantee that there will never be repetitions with the same artist showing in different chunks, I think.
Well that could be one way to do things, but not the best way. Fetching all the artists into local memory each time, sorting them there and then discarding those not wanted to be returned as JSON results is very ineffecient and slow. The faster and more accurate solution is to do both sorting and limits at the DB, with the correct SQL the db can do it all.

You can prove I am right using SQL directly if you like. Compare the results of
Code:
SELECT artistview.* FROM artistview 
WHERE ((
EXISTS (SELECT 1 FROM song_artist
WHERE song_artist.idArtist = artistview.idArtist AND song_artist.idRole = 1)
OR EXISTS (SELECT 1 FROM album_artist WHERE album_artist.idArtist = artistview.idArtist))
AND (artistview.strArtist != ''))
AND (artistview.strArtist <> 'Various artists')
LIMIT 1500,750
with
Code:
SELECT artistview.* FROM artistview
WHERE ((
EXISTS (SELECT 1 FROM song_artist
WHERE song_artist.idArtist = artistview.idArtist AND song_artist.idRole = 1)
OR EXISTS (SELECT 1 FROM album_artist WHERE album_artist.idArtist = artistview.idArtist))
AND (artistview.strArtist != ''))
AND (artistview.strArtist <> 'Various artists')
LIMIT 1500,750
ORDER BY artistview.idArtist
Reply


Messages In This Thread
RE: Issue with MySQL & large music libraries resulting in duplicate artists - by DaveBlake - 2018-06-22, 07:59
Logout Mark Read Team Forum Stats Members Help
Issue with MySQL & large music libraries resulting in duplicate artists0