>>>>> "James" == James H Thompson <jht@stripped> writes:
<cut>
James> select * from resources left outer join reservations on resource_id
James> where
James> resources.characteristic1 = 'x'
James> and resoruces.charactertistic2 = 'y'
James> and not (
James> ( 'wanted_date_start' between reservations.start_date and
James> reservations.end_date)
James> or ( 'wanted_date_end' between reservations.start_date and
James> reservations.end_date)
James> or (reservations.start_date between 'wanted_date_start' and
James> 'wanted_date_start' )
James> );
James> Is mysql smart enough to do the date range checks as it does the left outer
James> join
James> so that it doesn't really create 100,000 x 5 million rows?
It should. EXPLAIN should show you this.
Regards,
Monty