File Organisation Flashcards
what is fixed-length storage? pros and cons
- the record size is fixed
- each file has records of one particular type only
- different files are used for different relations
- no record is larger than a block
pros:
recording and access is simple
cons:
wasteful of space
what are the options for deletion in fixed length storage?
- shift records up
- move last record into the gap
- fill the gap on the next insert
how is a free list implemented in fixed length storage?
file header points to the first free space, which points to the second, and so on. on insertion we use the pointer from the header then change the header pointer to the next one
how are variable-length records stored?
- variable length attributes are given enough bytes to store an offset and a length
- fixed length attributes allocated enough bytes to store their values
- null values represented using a null-value bitmap
- the block header contains the number of entries, the end of the free space in the block, and the location and size of each record
describe sequential file organisation, and how inserts
records are stored in a sequential order, sorted by the value of the search key of the records
suitable for applications that require sequential processing of the entire file
insertion:
if there is a free space, pop it in, if not it requires an overflow block
either way the pointer chain has to be updated to maintain the ordering
the file must be reorganised sometimes to restore order. can be costly, often done when system load is low
describe heap organisation
a record can be placed anywhere in the file where there is space. chained pointers to indicate search order