Garbage Collection
| From: | tedd | Date: | Thu, 05 Feb 2009 16:06:38 +0000 |
| Subject: | Garbage Collection | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-287712@lists.php.net to get a copy of this message | ||
Hi gang:
A related question to my last "Clarity needed" post.
I have a tutor table (showing all the tutors), a course table (showing all the courses), and a course-to-tutor table (showing all the instances of what tutor teaches what course).
Okay, everything works. Whenever I want to find out what courses a specific tutor teaches OR what tutors teach a specific course, I simply search the course-to-tutor table and bingo out pops the answer.
Now, how do you handle the situation when a tutor quits or when a course is no longer offered?
If I search the course-to-tutor table for all the tutors who teach a course and find a tutor who is no longer there OR search the course-to-tutor table for all the courses a tutor teaches and find a course that is no longer offered, how do you handle the record?
I realize that if either search turns up nothing, I can check for that situation and then handle it accordingly. But my question is more specifically, in the event of a tutor quilting OR removing a course from the curriculum, what do you do about the course-to-tutor orphaned record?
As I see it, my choices are to a) ignore the orphaned record or b) delete the orphaned record. If I ignore the record, then the database grows with orphaned records and searches are slowed. If I delete the orphaned record, then the problem is solved, right?
I just want to get a consensus of how you people normally handle it. Do any of you see in danger in deleting an orphaned record?
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com