So here's what I'm trying to do:
I have a number of events, each event represents a datetime range (like 07.03.2014 06:00 - 07.03.2014 08:00)
event is associated (one-to-many) to hall_schedule.
Then I want to search for all hall_schedule's that don't have events that cover some specific time range, for example:
"I want all hall_schedules where hall events don't cover the 07.03.2014 06:00 - 07.03.2014 08:00 range"
So the question is, in order to get the best performance, how do I design this? What is the best way to store events and later do the described search?
I'd be glad to use something specific to postgresql (9.3), whatever would give the best performance