[mythtv-users] Slow MySQL query after delete

Michael T. Dean mtdean at thirdcontact.com
Wed Sep 5 21:04:28 UTC 2007

On 09/05/2007 04:09 PM, David Rees wrote:
> With MySQL, this means you should periodically ANALYZE your tables
> when the content of them changes enough to possibly alter query plans.
> With Postgres, this means you should VACUUM ANALYZE your tables when
> the content of them changes enough.

Speaking of which--sorry to get on topic--this reminded me of an
important change that the OP should note...

OP, you still listening?  :)

In the new optimize_mythdb.pl that's in SVN trunk, we now do an ANALYZE
TABLE in addition to the REPAIR and OPTIMIZE.  Unfortunately the one in
SVN trunk relies on some Perl bindings functionality that's not in
0.20-fixes, but it should be an easy change.  The attached (untested)
patch (where I never even attempted executing the changed script) should
add the ANALYZE to a 0.20-fixes optimize_mythdb.pl.  If you patch your
copy and re-run optimize_mythdb.pl (when Myth isn't busy recording or
transcoding or whatever), does it help?

To patch your copy go to the directory that contains optimize_mythdb.pl
and run

patch -Np0 -i optimize_mythdb-analyze_table.patch

as a user with appropriate permissions (or copy the original, patch it,
and copy it back if you want to avoid running patch as root--which is
not a bad idea).

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: optimize_mythdb-analyze_table.patch
Url: http://mythtv.org/pipermail/mythtv-users/attachments/20070905/c01941b2/attachment.diff 

More information about the mythtv-users mailing list