Please enable JavaScript.
Coggle requires JavaScript to display documents.
File Organization - Coggle Diagram
File Organization
Page: collection of records
Collection of slots
Each slot contains a record
rid = <page id, slot number>
slot number: index inside a particular page
Fixed Length Records
packed organization: N records stored in fiest N slots
insert: at slot N+1, update N -> N+1
delete: move last slot to deleted slot, N -> N-1
unpacked organization: bitmap (1-full, 0-empty)
insert
linearly find a slot with 0 bit, flip, slower
delete
flip 1 -> 0, others do not change, faster
Variable length records
space divided to allocated vs. free space
ArrayList: # slots, slot number with absolute address/offset
end points to start of free space, updated when insert;
delete: offset to -1, fragmented space
if no space left, reorganize, rid (pid, slot #) remains unchanged
Record Format
System catelog: # of fields, field type
Fixed length
all records same length, same # of fields
address computed from system catalog
Read one, add offset
Variable length
store fields consecutively
use delimiters to denote end of a field
scan whole record to locate a field
store fields consecutively
array of integer offsets in the beginning
Column stores
Store data vertically
each column of relation = a file
File
Unordered (heap) Files
Linked List
Page directory