10-08-2013, 04:03 PM
Organizing Files for Performance
Organizing Files.ppt (Size: 238 KB / Downloads: 11)
Chapter Objectives(1)
Look at several approaches to data compression
Look at storage compaction as a simple way of reusing space in a file
Develop a procedure for deleting fixed-length records that allows vacated file space to be reused dynamically
Illustrate the use of linked lists and stacks to manage an avail list
Consider several approaches to the problem of deleting variable-length records
Introduce the concepts associated with the terms internal fragmentation and external fragmentation
Data Compression(2)
:Using a different notation
Fixed-Length fields are good candidates
Decrease the # of bits by finding a more compact notation
ex) original state field notation is 16bits, but we can encode with 6bit notation because of the # of all states are 50
Cons.
unreadable by human
cost in encoding time
decoding modules => increase the complexity of s/w
=> used for particular application
Deleting Fixed-length Records for Reclaiming Space Dynamically(1)
Reuse the space from deleted records as soon as possible
deleted records must be marked in special way
we could find the deleted space
To make record reuse quickly, we need
a way to know immediately if there are empty slots in the file
a way to jump directly to one of those slots if they exist
=> Linked lists or Stacks for avail list
* avail list : a list that is made up of deleted records
Storage Fragmentation
Internal fragmentation (in fixed-length record)
waste space within a record
in variable-length records, minimize wasted space by doing away with internal fragmentation
External fragmentation (in variable-length record)
unused space outside or between individual records
three possible solutions
storage compaction
coalescing the holes: a single, larger record slot
minimizing fragmentation by adopting placement strategy