I was trying to find out how many of my tracks I have rated, so I ran:
----- Begin Query 1 -----
SELECT COUNT(*), rating FROM slimserver.track_statistics GROUP BY rating
COUNT(*)  rating
12259     NULL
14        20
981       40
7300      60
28714     80
1613      100
----- End Query 1 -----

I thought that was a little curious as the total is 50,881, whereas
Slim Server reports 16281 songs.  So I did a little more digging.

----- Begin Query 2 -----
SELECT DISTINCT url, COUNT(url) as count FROM track_statistics GROUP BY url 
ORDER BY COUNT(url) DESC
This reports:
#URLs   Count
4       5761
2       2401
2       241
2       190
22      122
24      121
2       54
~100    3
~20     2
----- End Query 2 -----

I looked at one of the duplicates and all the data seems to be the
same.  Is there a reason duplicates are allowed in the URL column?
Seems to me that should be a primary key or made unique through the
combo of url and musicbrainz_id.  Am I totally out in left field here?

This is with TrackStat 1.39 and Slim Server 6.5.5 on Debian unstable. I
first installed TrackStat over a year ago (version forgotten) and have
updated as new releases come out.  At one point I wiped the database
and re-imported from the xml backup.  The XML shows a slightly worse
story:
egrep '<url>' trackstat_scheduled_backup_20071104.xml | sort | uniq -c | sort -n
----- Begin egrep output -----
[ snip a bunch of others ]
    243 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Fmisc%2Fsoundtrack [snip ]
    243 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Ftrance%2FClub%2FS [snip ]
    272 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Ftrance%2FClub%2FS [snip ]
    299 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Fmisc%2FTop%252010 [snip ]
    379 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Fmp3%2Fbestof%2FGr [snip ]
    399 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Fmisc%2FTop%252010 [snip ]
   4067 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Ftrance%2FMixes%2F [snip ]
   5106 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Ftrance%2FMixes%2F [snip ]
   9914 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Ftrance%2FMixes%2F [snip ]
  15731 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Ftrance%2FMixes%2F [snip ]
  20081 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Ftrance%2FMixes%2F [snip ]
  24768 <url>file%3A%2F%2F%2Fdata%2Faudio%2Fmusic%2Ftrance%2FMixes%2F [snip ]
----- End egrep output -----

I cut a bunch, but you get the idea, lots of repeats of the same url.

-- 
"You can't kill electrons, the worst thing you can do is send them on
long trips in which they are not interested."
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to