[mythtv-users] Database purge

Michael T. Dean mtdean at thirdcontact.com
Thu Sep 7 03:54:52 UTC 2006

On 09/06/2006 04:21 PM, Nick wrote:

>On 06/09/06, Ben Dash <ben_dash at yahoo.com> wrote:
>>My database has just filled up its partition and I
>>want to purge 90% of it since I really don't care to
>>have a record of every single TV show that ever
>>broadcast over the past 2 years :-)
>>Does anyone have a convenient SQL script to purge the
>>data that isn't needed while still maintaining the
>>tables related to the TV guide and the current
>>recorded shows and future recordings scheduled?
>Have you run optimize_mythdb.pl on the database?
>Checking my current DB - almost 2 years old - the largest table is
>recordedseek (24MB)
In 0.19, recordedmarkup (which was split into two tables, recordedmarkup 
(which will be small) and recordedseek (which will be large for users 
with MPEG-2 recordings)).

> - so if you have lots of recordings stored this
>could be the culprit (I currently only have 66 recordings). There may
>also be orhpaned records for long-deleted recordings which can be
>deleted also and may drastically reduce your DB size.
>The current size of my 2yo DB is <50MB.
Right.  As Nick said, and as you discovered, it's not your DB that's 
filling up the partition.

Note, though, that to "clean up your database," you simply have to run 
mythfilldatabse.  Even if all your sources use EIT information only 
(i.e. data broadcast with the TV signal, instead of data downloaded from 
the Internet), you need to run mythfilldatabase to let it clean up your 

By default, mythfilldatabase will delete any program listings for shows 
that have already aired.  If you specify the --no-delete option, it will 
delete listings for shows that are over a week old.  And, 
mythfilldatabase also cleans up other tables, like people, genres, 
credits, etc.

See http://www.gossamer-threads.com/lists/mythtv/users/216464#216464 
(and, if appropriate, make sure you're running a new enough version of 
MythTV to handle cleanup even with eitonly sources)


More information about the mythtv-users mailing list