[mythtv] Why are there so many instances of recordedseek?

Dan Wilga mythtv-dev2 at dwilga-linux1.amherst.edu
Tue Apr 21 13:26:18 UTC 2015


On 4/20/15 9:04 PM, Nick Morrott wrote:
> You can find the start times of recordedseek entries that do not
> relate to current recordings using some brute force:
>
> SELECT DISTINCT `starttime`
> FROM `recordedseek`
> WHERE `starttime` NOT IN (SELECT `starttime` FROM `recorded`)
> ORDER By `starttime` ASC;
A subselect is a not a very efficient way to do this query, because of 
the potential size. I tried it and stopped it after five minutes. It 
also doesn't take into account the possibility of two programs having 
recorded at the same time. This is still slow, but better:

SELECT s.starttime, s.chanid FROM recordedseek s
   LEFT JOIN recorded r ON r.chanid = s.chanid AND r.starttime = s.starttime
   WHERE r.chanid IS NULL GROUP BY s.starttime, s.chanid



More information about the mythtv-dev mailing list