[mythtv-users] Slow MySQL query after delete

Victor Perez spectro at gmail.com
Tue Sep 4 15:31:37 UTC 2007

On 9/4/07, f-myth-users at media.mit.edu <f-myth-users at media.mit.edu> wrote:

> Why does the query take so long?  Presumably because you have a lot
> of "record on any channel" rules, and a large number of things in
> oldrecorded, for starters.  The enormous amount of time for running
> this query was discussed at length around early March of this year in
> the context of fixing Myth not to hang the process that was reading
> from ivtv while the scheduler was running---this caused massive
> corruption and tens of seconds missing in recordings because the
> GOP-writer couldn't write (hanging the entire thread) while it was
> waiting on a lock held by the scheduler.  Patches were produced for
> 0.18 and also for 0.19 and 20/svn etc at that time which made the
> behavior substantially better, but people still discussed why the
> scheduler query was taking so long, in part because it has obvious bad
> consequences for the UI, as you've seen.  (I haven't gone and dug up
> the thread, but this is probably enough for someone else to find it
> pretty fast; I was a participant in it if that helps.)
> This is also why I tend to try -not- to have lots of "all channels"
> rules (even though MT Dean tends to recommend them a lot), because
> there was some evidence that they tended to make the scheduler queries
> take even -longer-, and typically I know that most programs are
> unlikely to surface on other channels---when I'm not sure, I use an
> "all channels" rule anyway.
IMHO the query is pretty quick but (at least in my case) returns a whole lot
of information. I got 1168 rows back in 4 seconds but the data makes a 421K
file. In my opinion the delay is from mythtv parsing through this huge
dataset so we would need to find out why does it need that much information
back on each row, program's primary key should be enough for mythtv to find
the next program to record.

I've been waiting for somebody to fix these issues for a while. My remote
frontend hangs and I have to kill it every time I delete something. Now that
I compiled from the sources to get the SD patches I think I finally gonna
get my hands dirty and fix with this whole database mess the developers got
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070904/e178cb6d/attachment.htm 

More information about the mythtv-users mailing list