[mythtv-users] Slow MySQL query after delete

Andrew Burgess aab at cichlid.com
Tue Sep 4 13:38:07 UTC 2007

>When I run that SELECT in mysql it consistently returns 3694 rows in around
>31 seconds.  I had run optimize_mythdb.pl.  Running it again had no effect.

I don't know jack about mysql. But here is what I would try
from a general troubleshooting point of view.

  time mysql <args to make it run the query>

Compare realtime and sys+user time. About the same and the
query is cpu bound. Big difference and its disk bound.
Hard to imagine disk bound if every run is slow, the 2nd and
subsequent times the disk data is all in kernel buffers

Look into oprofile, I've found really interesting bugs using
it. It profiles the application (mysql), the system libs and
the kernel all in one go.

Did you try backing up the database, deleting the old one
and then rebuilding from the backup?

In any case it might be worth tar-ing up the current
database before you fix it to eventually have the mysql
developers take a look.


More information about the mythtv-users mailing list