Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Database Cleanup don't really clean all up
#1
Dear all,

Using MySql I noticed that the "uniqueid" table contains a lot of obsolete records.
It seems that when I replace a file the tables episode / movie / files / path / seasons are cleaned up correctly, but uiniqueid will be leaved back and wasting storage (and performance) for ever.
Is this supposed to be, or is it a glitch / bug?
As i do not use local database since more than a decade I'm curious if this also happen to SQLite.

Best regards
Reply
#2
Maybe this will help you:

https://forum.kodi.tv/showthread.php?tid=369984
Reply
#3
Thanks @HeresJohnny, this is not the expected answear Smile, but I can assume that it should be and KODI do have problems with orphaned records. Right?
Thank you very much for your fast help.
Reply
#4
(2024-01-01, 15:53)HeresJohnny Wrote: Maybe this will help you:

https://forum.kodi.tv/showthread.php?tid=369984

I just checked the code and the Wiki page and I am not checking the uniqueid table for orphans with Kodi Selective Cleaner.  I'll look to add this in the next release.  Not sure how I missed this originally. 


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#5
(2024-01-01, 20:17)BiTeMeNoW Wrote: but I can assume that it should be and KODI do have problems with orphaned records. Right?

correct

outside of database triggers (in the database itself) i do not believe kodi makes any effort to clean the database, it's the same for the "path" table, after long term use you will notice a lot of bits

if comfortable and confident enough i recommend adding custom triggers to aid keeping these entries cleaned up
Reply
#6
(2024-01-01, 22:02)izprtxqkft Wrote:
(2024-01-01, 20:17)BiTeMeNoW Wrote: but I can assume that it should be and KODI do have problems with orphaned records. Right?

correct

outside of database triggers (in the database itself) i do not believe kodi makes any effort to clean the database, it's the same for the "path" table, after long term use you will notice a lot of bits

if comfortable and confident enough i recommend adding custom triggers to aid keeping these entries cleaned up

This thread got me curious.  I looked at an SQLite MyVideos122 and a MySQL myvideos122 database and there are 4 triggers which clean the uniqueid table when either an episode, movie, musicvideo  or tvshow is removed. 

When I add the uniqueid table into the analyzer it will be interesting to see the results.  Triggers work fine as long as things operate properly.  However, things sometimes go wrong or  go in the wrong sequence.  It could also be that there are enough remnants in the database that the trigger hasn't fired and just running KS Cleaner to clean out the other stuff may cause the triggers to fire. 

I'll try to get the uniqueid table added before I head out on vacation in just over 2 weeks.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#7
(2024-01-01, 23:07)jbinkley60 Wrote: This thread got me curious.  I looked at an SQLite MyVideos122 and a MySQL myvideos122 database and there are 4 triggers which clean the uniqueid table when either an episode, movie, musicvideo  or tvshow is removed. 

When I add the uniqueid table into the analyzer it will be interesting to see the results.  Triggers work fine as long as things operate properly.  However, things sometimes go wrong or  go in the wrong sequence.  It could also be that there are enough remnants in the database that the trigger hasn't fired and just running KS Cleaner to clean out the other stuff may cause the triggers to fire. 

I'll try to get the uniqueid table added before I head out on vacation in just over 2 weeks.


Thanks,

Jeff

Thank you Jeff. This cleaner is really appreciated. I was lookin to do it manually as my library is quite old (over a decade now) and there are a lot of orphaned entries in many tables  Laugh
Best regards
Reply
#8
I used the cleaner tool last fall on my +10 year old database and reduced it from ~230gb to ~110gb.  It works really well.

Cheers
TRJB
Reply

Logout Mark Read Team Forum Stats Members Help
Database Cleanup don't really clean all up0