Download 5. Object Orientation

Transcript
drive a distance (999 x Record_Size) from the beginning of the
file, and thus avoid reading all the records earlier in the file. It
also means that when a record is deleted, then another one
added, the added one can fit in the same length space as the one
deleted. (If the added record were shorter, some space would be
wasted. If it was longer, it wouldn’t fit and would have to be
placed elsewhere and the entire space from the deletion would
be wasted until a smaller record needed to be added.)
But not all data records appear to be of fixed length. For
instance a student and the courses she is taking this semester:
Student (student-id, semester, {course})
where {} is the Backus-Naur Form (BNF) symbol for zero or
more courses. This is called a repeating group by database
analysts.
For access performance, we would like to use fixed length disk
records, but some students take more courses than others. If say
we reserve space for 6 courses for every student, huge amounts
of space are wasted if most students only take 5 courses on
average.
Properly analyzing the data structure for such an application is
done by constructing a data model of the information that needs
to be retained, and modifying that model until you get:
1) fixed length records.
2) no wasted space due to empty or duplicated data.
3) fast random and sequential access.
4) fast insert and delete operations (not possible with simple
sorted records - why?)
5-62