[mythtv] Scheduler needs table keys?

Bruce Markey bjm at lvcm.com
Mon Jan 29 03:21:23 UTC 2007


Chris Pinkham wrote:
> * On Sat Jan 27, 2007 at 11:34:26PM -0800, Bruce Markey wrote:
>> I'd always favored All for simplicity but checking a few
>> hundred programs on a channel is much quicker that searching
>> thirty or forty thousand programs.
> 
> Yeah, after running those tests on my system, it made me want
> to go back and change a bunch of them to only record on the
> original channel.  Most shows we record are never going to
> switch networks, they'd get cancelled first. :)

I have to admit that I'm surprised. If there are 40,000 entries
and 400 on one channel, it still has to match the items with
that chanid or actually any chanid with the same callsign in
the channel table as the original chanid, then match the indexed
string of the title. It shows how drastically different it is
to match the chanid ints compared to matching indexed strings.

This only really matters when starting the MBE or at the end
of an mfdb run when it rematches all the showings to all of the
rules. When David added the recordmatch stuff, I put the "match"
time and "place" time in the verbose messages.

bjm at nordtv ; grep match /var/log/myth/mb.log
...
2007-01-28 15:50:05.041 Scheduled 255 items in 2.4 = 0.33 match + 2.06 place
2007-01-28 16:06:35.414 Scheduled 254 items in 1.2 = 0.00 match + 1.20 place
2007-01-28 16:07:08.483 Scheduled 254 items in 1.2 = 0.01 match + 1.20 place
2007-01-28 17:37:38.822 Scheduled 253 items in 3.3 = 0.56 match + 2.74 place
2007-01-28 17:39:20.600 Scheduled 249 items in 1.2 = 0.01 match + 1.19 place
2007-01-28 17:40:54.279 Scheduled 249 items in 1.2 = 0.01 match + 1.19 place

The match times are negligible unless there is a full resched.

: bjm at nordtv ; mythbackend --resched
...
2007-01-28 18:28:08.892 Scheduled 249 items in 9.6 = 8.18 match + 1.40 place

This is with 66 of the ugliest kPowerSearch rules than anyone
would have (I assume =). I've always been more concerned about
the impact of complex rules than All vs Channel which I assumed
was a wash. I'm now thinking that I might start adding "Only on
a specific station" to custom rules when I know a show is only
on a specific station. Until now I would have thought that another
clause would slow things down but I guess it would speed things up.

I'm also surprised by the reactions. There is nothing wrong with
using All but Channel will be faster in matching when a show is
known to be only on one station.

But again, this only matter during at the end of mfdb while you
are asleep. I think what makes more difference during the day
is "place" while the schedule is being filled in from the pre-
identified matching showings. Here I like to keep my reclist
short so there are fewer items to weed through to when placing.

An example that I used recently was that Top Chef had the final
two episodes upcoming but a total of 77 showings. I use the
program.first flag to match just the earliest showings of
the two last episodes and not match the other 75. This is also
the reason for the recently added "Exclude old episodes". Why
include rsRepeats in the reclist? If someone had, say, one
thousand two hundred twenty seven items in their reclist and
they didn't actually watch fifty to one hundred programs every
day, it might take sixteen seconds to fill in the schedule.

You also mentioned the size of your oldrecorded table. It is
a good thing that myth remembers the episodes you watched forever
rather than forgetting them after two months like the leading
commercial DVR but it does require some maintenance. This is
why the Previously Recorded page was originally added. You
should periodically clean up.

I record SportsCenter anywhere from 365 to 366 times per year
but no matter how slow of a sports day it is, they never show
old reruns. I can "Remove all episodes for this title" for
SportsCenter and anything like it and do so frequently. Same
for shows that have been canceled or I've decided to stop
watching. In fact, the only things that need to be in the
oldrecorded are shows that have unique episodes that might
be repeated and you still record, plus movies or specials that
might match search rules. I usually have my table trimmed down
to a few hundred lines.

--  bjm





More information about the mythtv-dev mailing list