File Organisation Flashcards

1
Q

what is fixed-length storage? pros and cons

A
  • 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the options for deletion in fixed length storage?

A
  • shift records up
  • move last record into the gap
  • fill the gap on the next insert
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how is a free list implemented in fixed length storage?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how are variable-length records stored?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

describe sequential file organisation, and how inserts

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

describe heap organisation

A

a record can be placed anywhere in the file where there is space. chained pointers to indicate search order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly