[mythtv-users] optimize_mythdb.pl (was Re: 0.19 Program Guide slowness...)

Michael T. Dean mtdean at thirdcontact.com
Fri Feb 24 08:16:26 UTC 2006


On 02/23/2006 06:06 PM, Phill Edwards wrote:

>>i have a cron job that goes through CHECK TABLE, REPAIR TABLE, OPTIMIZE
>>TABLE, and ANALYZE TABLE every night (i think, maybe every week) on all
>>servers that host any coding projects (i am our head php/mysql
>>developer) ... i've noticed a DEFINITE performance increase since i
>>started doing this
>>    
>>
>So would it come after the Optimise and look like this?
>
># Repair and optimize each table
>    foreach $table (@tables) {
>        unless ($dbh->do("REPAIR TABLE $table")) {
>            print "Skipped:  $table\n";
>            next;
>        };
>        if ($dbh->do("OPTIMIZE TABLE $table")) {
>            print "Repaired/Optimized: $table\n";
>        }
>        if ($dbh->do("ANALYZE TABLE $table")) {
>            print "Analysed: $table\n";
>        }
>    }
>  
>

Just thought I'd mention that Chris Petersen wrote a script that does 
all of this except the analyze step.  The script is in the source 
package at contrib/optimize_mythdb.pl and includes comments which 
describe how to set it up.

Chris, any comments on the addition of the analyze table stuff?

Mike



More information about the mythtv-users mailing list