View Single Post
Old 07-15-09, 04:32 PM   #7
Official pain in the ass
Tuork's Avatar
Join Date: May 2003
Posts: 1,197
Send a message via MSN to Tuork
Default Re: Timetable in MySQL

Originally Posted by ViN86 View Post
Sure, but you don't expect to have more than 12 hour shifts right? So a simple function to subtract the times should be pretty easy.
By itself a single shift is no biggie. The problem resides in the number of Tutors/Students that the system will manage. We're talking about something like 200 students and 50 tutors. Take into account the number of days in a week and say 12 hour "shifts", and you get approximately

200*50*7*12 = 840,000 records!!!!!

I could index it by user ID, but still, searching though all those records will prove to be taxing for the database manager.

EDIT: You could also try storing all start/end times as the number of seconds. Then a subtraction would be easy and converting back to the time could be done with a simple function as well.
Could do that as well. Guess I'll look into the specifics once I'm developing, but for now it's good to have the general idea of what to do.
My avatar: "An obscure and non sensical pattern made to get people to post what they think it is" - Vamp

Dell XPS M1530
Core2Duo T5550 1.86Ghz | 3GB DDR2 | 8600M GT 256MB | 250GB Hdd | BenQ FP202W 20" LCD | MX1000 mouse | Inspire T5400 5.1
Tuork is offline   Reply With Quote