Database management system File organization-sk.pdf

yashasthana0158 17 views 8 slides Apr 29, 2024
Slide 1
Slide 1 of 8
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8

About This Presentation

it describes the file organization in database management system


Slide Content

File organization

FILES
•FIXED and variant length records
•Blocking factor of a file: Number of records per disk block for a file
•floor(B/R) where B: Block size, R: Record size
•Unspannedvs spanned file organization

Operations on Files
•Retrieval operations
•No change to file data
•Update operations
•File change by insertion, deletion, or modification
•Records selected based on selection condition
Slide 16- 3

Operations on Files (cont’d.)
•Examples of operations for accessing file records
•Open
•Find
•Read
•FindNext
•Delete
•Insert
•Close
•Scan
Slide 16- 4

Files of Unordered Records (Heap Files)
•Simplest file organization where records are placed in the order in which
they arrive
•Heap (or pile) file
•Records placed in file in order of insertion
•Inserting a new record is very efficient
•(copy last disk block in memory, add new record, rewrite block on disk)
•Searching for a record requires linear search
•Compute intensive, on average b/2 blocks are accessed where b: number of disk
blocks allotted to a file
•Deletion techniques
•Rewrite the block
•Use deletion marker to handle unused space
•Periodic reorganization of the file
Slide 16- 5

Direct/Relative file
•If Heap file with fixed-length record uses unspanned organization, and
contiguous allocation then ith record can be directly accessible
• If the file records are numbered 0, 1, 2, ..., r − 1 and the records in
each block are numbered 0, 1, ..., bfr − 1, where bfr is the blocking
factor, then the ith record of the file is located in block ⎣(i/bfr)⎦ and is
the (i mod bfr)th record in that block.
•Useful in creating access paths/index for faster retrieval

16.7 Files of Ordered Records (Sorted Files)
•Ordered (sequential) file
•Records sorted by ordering field
•Called ordering key if ordering field is a key field
•Advantages
•Reading records in order of ordering key value is extremely efficient
•Finding next record
•Binary search technique
Slide 16- 7

Access Times for Various File Organizations
Slide 16-8
Table 16.3 Average access times for a file of b
blocks under basic file organizations
Tags