On Mar 1, 2010, at 8:30 AM, Sean Clark Hess wrote:

> We have a database full of tv listing information. I want to write a view
> that will let me say "What is playing on ESPN at 14:45?" One way I can
> accomplish this is to emit the show multiple times, on the half hour, and
> then only ask what is playing at each half-hour interval. This is no ideal,
> because it makes my view bigger (and this table is already huge).
> 

This is the right way to do it. Hopefully disk space trends to free fast enough 
to support your app. :) Probably each show will only emit a handful of times 
anyway, so the cost isn't actually so high.

the alternative is to emit the start and end times, and then make up for it 
with a lot of complexity on the the query side. this alternative approach will 
only work if you can lay down a validation saying what the longest allowable 
show is, and then base your complex query logic around it. I'd recommend the 
first approach instead.

Chris

> Can anyone think of a better idea? I'm willing to change how the objects are
> stored if that would help.
> 
> *Event Database Objects*
> { "network": "ESPN", "date":"2010-02-28", "time":"14:30", "duration" :
> "01:25" }

Reply via email to