[mythtv-commits] Ticket #4609: Scheduler speedup - SQL with negative values on unsigned int columns.
MythTV
mythtv at cvs.mythtv.org
Thu Feb 7 16:03:18 UTC 2008
#4609: Scheduler speedup - SQL with negative values on unsigned int columns.
-----------------------------------------------------+----------------------
Reporter: Mark Buechler <Mark.Buechler at gmail.com> | Owner: ijr
Type: patch | Status: new
Priority: minor | Milestone: unknown
Component: mythtv | Version: head
Severity: medium | Mlocked: 0
-----------------------------------------------------+----------------------
I've noticed a very long running query in the scheduler "DELETE FROM
program WHERE manualid = -1 OR (manualid <> 0 AND -1 = -1);" which is
invalid due to manualid being defined as an unsigned int (as well as
recordid). This, on my system running mysql 5.0.41, takes typically 11
seconds to run. By removing the negative value in the WHERE clause it
takes 0 seconds.
Attached is a patch that, instead of doing the check for "RECORDID = -1"
in SQL, it does it in code thus eliminating the slow WHERE clause.
There may be more of these but these are the two biggest for me. With this
patch, my scheduler runs go from 17 seconds average down to 5-6 seconds
average.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/4609>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list