[mythtv-users] Converting scripts to not use the database directly

jedi jedi at mishnet.org
Mon Nov 3 20:43:06 UTC 2014


On Mon, Nov 03, 2014 at 11:22:43AM -0500, Michael T. Dean wrote:
> On 11/03/2014 03:13 AM, Simon Hobson wrote:
> >Bill Meek wrote:
> >
> >>If user's contributed libraries, then the original task of setting visible
> >>to false would look like this (in Python):
> >>
> >>    import Channel
> >>    Host='someHostName'
> >>    for chanid in '1021', '1091', etc.
> >>        channelDict = Channel.GetChannelInfo(host=Host, chanid=chanid)
> >>        channelDict['Visible'] = 'false'
> >>        Channel.UpdateDBChannel(host=Host, rdict=channelDict)
> >>
> >>I'd say that's a very reasonable substitute for the SQL, and much safer, Once
> >>the key issue is resolved (easily handled in the Channel module for now.)
> >
> >I disagree.
> >Yes it's a substitute, and probably workable, but from what I'm seeing it looks like a very inferior substitute.
> >
> >It looks like a simple statement :
> >>update channel set channum=channum+10000 where channum<  1000 and not channum between 700 and 799
> >becomes a loop where I've got to work through all the channels, perform a test, and update some of them.
> 
> And we all know just how long a modern computer takes to loop
> through hundreds of things (or even a couple thousand for some

    You're trying to be sarcastic but this is actually the truth.

    Doing things in the least efficient way that you can possibly think
of will in fact bog down a modern computer system. You can easily see
this for yourself and it doesn't take a huge dataset to do it either.

[deletia]


More information about the mythtv-users mailing list