[mythtv-users] [PATCH] Full table scan on program table

Kevin Kuphal kuphal at dls.net
Sun Sep 5 14:18:01 EDT 2004


Brian Scully wrote:

>I've been tweaking this a bit, and i've got another perceptible boost, although much smaller than the last one - it rids this query of all full table scans.
>
>ALTER TABLE channel ADD_INDEX channelnum (channum, sourceid);
>
>This should probably be a unique index, but i've got some duplicate channums - maybe due to upgrades, I don't know.  I'm gonna do a little research and maybe pull out the dupes.  Sourceid isn't necessary for me (i've only got one source), but it's probably better to be generic in this case.
>  
>
Brian,

Good work indeed, I'd love to see if you might find even more 
optimizations, but in this case, you should drop this to the -dev list 
but you will probably want to put this in the form of a patch which 
means modifying the dbcheck.cpp file in the libmythtv folder.  When 
updating database schema, increase the version number at the top of the 
page and then add your code at the end of the UpgradeTVDatabaseSchema 
function using a dbver check for your new version number.  It is very 
straightforward and you need only mimic the other code there and 
assuming this doesn't break anything, I'm sure that Isaac would 
appreciate the effort.

Kevin



More information about the mythtv-users mailing list