List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:October 12 1999 1:32pm
Subject:Re: How to best implement a reservation system
View as plain text  
>>>>> "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
Thread
How to best implement a reservation systemJames H. Thompson10 Oct
  • Re: How to best implement a reservation systemPatrick Greenwell10 Oct
    • Re: How to best implement a reservation systemJames H. Thompson11 Oct
      • Re: How to best implement a reservation systemPatrick Greenwell12 Oct
        • Re: How to best implement a reservation systemJames H. Thompson12 Oct
          • Re: How to best implement a reservation systemMichael Widenius12 Oct