File Organization - File Organization 1. A file is...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1. A file is organized logically as a sequence of records. 2. Records are mapped onto disk blocks. 3. Files are provided as a basic construct in operating systems, so we assume the existence of an underlying file system . 4. Blocks are of a fixed size determined by the operating system. 5. Record sizes vary. 6. In relational database, tuples of distinct relations may be of different sizes. 7. One approach to mapping database to files is to store records of one length in a given file. 8. An alternative is to structure files to accommodate variable-length records. (Fixed-length is easier to implement.) Fixed-Length Records Variable-Length Records o Byte string representation o Fixed-length representation Fixed-Length Records 1. Consider a file of deposit records of the form: 2. aaaaaaaaaaaa¯ type deposit = record 3. 4. bname : char(22); 5. 6. account# : char(10); 7. 8. balance : real; 9. 10. end 11. o If we assume that each character occupies one byte, an integer occupies 4 bytes, and a real 8 bytes, our deposit record is 40 bytes long. o The simplest approach is to use the first 40 bytes for the first record, the next 40 bytes for the second, and so on. o However, there are two problems with this approach. o It is difficult to delete a record from this structure. o
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/25/2010 for the course CMPN SEM4 taught by Professor Thakur during the Spring '07 term at University of Mumbai.

Page1 / 4

File Organization - File Organization 1. A file is...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online