[mythtv-users] Slow MySQL query after delete

Michael Rice mikerice1969 at gmail.com
Sat Dec 1 22:13:44 UTC 2007


On Dec 1, 2007 12:52 PM, David Brodbeck <gull at gull.us> wrote:
>
> On Nov 30, 2007, at 9:17 PM, Michael T. Dean wrote:
> > How many times do I have to say, "His system takes the same amount of
> > time for a scheduling run as my system and my system does /not/ lock
> > up--or show /any/ delay at all--after a delete,"...
>
> It will if you immediately try a second delete.  That will force a
> second scheduler query, which will block because the first one still
> has the tables locked.  Same if you go in Mythweb and try to edit two
> schedules in quick succession.

Right.  So from looking at my logs carefully I think I see what
is happening.  When the front end deletes it does a:

UPDATE record SET last_delete = <date>.

That's ok since it is the first delete and the BUSQ has not
started yet.  Now if you time it correctly and start another
delete after the BUSQ starts, the UPDATE record will be
blocked and the frontend hangs until the BUSQ completes
(or unlocks the table).

That explains why I didn't see it EVERY time I did two
deletes.  It is all in the timing.

That's my theory anyway... If that's true I don't know
what can be done about it...  I can try removing that
update and see what happens but I have to go buy a
Christmas tree and let some more kid shows record
before I test anymore.  :)


More information about the mythtv-users mailing list