Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am not sure if this has been asked before, however I am tasked with designing a new reservation system for my organization

We have an older system which simply stored the booking in a table, and it worked pretty well, but it becomes quite slow when I try to determine what time slots are free (It has to get the open/close time range, and calculate whats free by taking away whats booked). Ideally, I would like a better solution for this, and I am hoping that somebody has solved the problem before.

The booking system itself will display only one day at a time, listing whats booked & whats available for that specific day.

share|improve this question
1  
need more business rules to go on. Sounds like you need better requirements. Would love to help but this is not much to go on. –  B Woods Mar 27 at 17:57
    
It's still in the early stages of design, but it will be a self-serve booking system where a user will be able to log in, and book a slot for a limited period of time. It's still undecided if it will display when each item is booked, but it will definitely be displaying if said item is available for booking –  Señor Reginold Francis Mar 27 at 18:30
2  
Unless your bookings are for very carefully regimented blocks of time (days, hours, half hours, etc.) you're really better off recording what is booked, not what's available. Do you have an efficient, set-based query for calculating what's available, such as one from the answers to this question: stackoverflow.com/questions/9604400/… ? –  Joel Brown Mar 28 at 11:56

1 Answer 1

As Jon says, you would be better off storing bookings rather than availability. This will make any future changes to operating hours or booking conditions easier (slot length, minimum/maximum booking duration etc). Also, you won't have to pre-populate an availability table out to some arbitrary future date.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.