1 / 21

Introduction to Direct Access Files.

Introduction to Direct Access Files. Sequential Files - Adding a Record. Ordered. Rec085. Unordered. Rec001 Rec005 Rec045 Rec090 Rec100 Rec150 Rec300 Rec325 ^Z. Rec300 Rec150 Rec005 Rec090 Rec045 Rec100 Rec001 Rec325 ^Z. Sequential Files - Adding a Record. New-Ordered.

amil
Download Presentation

Introduction to Direct Access Files.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction toDirect AccessFiles.

  2. Sequential Files - Adding a Record Ordered Rec085 Unordered Rec001 Rec005 Rec045 Rec090 Rec100 Rec150 Rec300 Rec325 ^Z Rec300 Rec150 Rec005 Rec090 Rec045 Rec100 Rec001 Rec325 ^Z

  3. Sequential Files - Adding a Record New-Ordered Rec085 Extend-Unordered Rec001 Rec005 Rec045 Rec085 Rec090 Rec100 Rec150 Rec300 Rec325 ^Z Rec300 Rec150 Rec005 Rec090 Rec045 Rec100 Rec001 Rec325 Rec085 ^Z

  4. Sequential Files - Deleting a Record Ordered Rec150 Unordered Rec001 Rec005 Rec045 Rec090 Rec100 Rec150 Rec300 Rec325 ^Z Rec300 Rec150 Rec005 Rec090 Rec045 Rec100 Rec001 Rec325 ^Z

  5. Sequential Files - Deleting a Record New-Ordered Rec150 New-Unordered Rec001 Rec005 Rec045 Rec090 Rec100 Rec300 Rec325 ^Z Rec300 Rec005 Rec090 Rec045 Rec100 Rec001 Rec325 ^Z

  6. Sequential Files - Amending a Record Ordered Rec045 Unordered Rec001 Rec005 Rec045 Rec090 Rec100 Rec150 Rec300 Rec325 ^Z Rec300 Rec150 Rec005 Rec090 Rec045 Rec100 Rec001 Rec325 ^Z

  7. Sequential Files - Amending a Record New-Ordered Rec045 New-Unordered Rec001 Rec005 Rec045 Rec090 Rec100 Rec150 Rec300 Rec325 ^Z Rec300 Rec150 Rec005 Rec090 Rec045 Rec100 Rec001 Rec325 ^Z

  8. Relative Files - Organization Rec001 free Rec003 Rec004 free free Rec007 Rec325 Rec326 free Rec328 1 2 3 4 5 6 7 325 326 327 328 Relative RecordNumber

  9. Relative Files - Adding a Record Rec001 free Rec003 Rec004 free free Rec007 Rec325 Rec326 free Rec328 1 2 3 4 5 6 7 325 326 327 328 Rec327 Relative RecordNumber

  10. Relative Files - Adding a Record Rec001 free Rec003 Rec004 free free Rec007 Rec325 Rec326 Rec327 Rec328 1 2 3 4 5 6 7 325 326 327 328 Rec327 Relative RecordNumber

  11. Relative Files - Deleting a Record Rec001 free Rec003 Rec004 free free Rec007 Rec325 Rec326 free Rec328 1 2 3 4 5 6 7 325 326 327 328 Rec325 Relative RecordNumber

  12. Relative Files - Deleting a Record Rec001 free Rec003 Rec004 free free Rec007 deleted/free Rec326 free Rec328 1 2 3 4 5 6 7 325 326 327 328 Rec325 Relative RecordNumber

  13. Relative Files - Amending a Record Rec001 free Rec003 Rec004 free free Rec007 Rec325 Rec326 free Rec328 1 2 3 4 5 6 7 325 326 327 328 Rec007 Relative RecordNumber

  14. Relative Files - Amending a Record Rec001 free Rec003 Rec004 free free Rec007 Rec325 Rec326 free Rec328 1 2 3 4 5 6 7 325 326 327 328 Rec007 Relative RecordNumber

  15. Indexed Files - Organization H R Z Index Records C F H L O R T W Z Mi Nf Ni Nt Oi Ot Data Records

  16. Indexed Files - Reading Record Ni H R Z Index Records C F H L O R T W Z Mi Nf Ni Nt Oi Ot Data Records

  17. Indexed Files - Reading Record Ni H R Z Index Records C F H L O R T W Z Mi Nf Ni Nt Oi Ot Data Records

  18. Indexed Files - Reading Record Ni H R Z Index Records C F H L O R T W Z Mi Nf Ni Nt Oi Ot Data Records

  19. Sequential Files. • Slow - when the hit rate is low. • Complicated to change (insert, delete, amend) • Fast - when the hit rate is high. • Most storage efficient. • Simple organization. • Recovers space from deleted records. Disadvantages. Advantages.

  20. Relative Files. • Wasteful of storage if the file is only partially populated. • Cannot recover space from deleted records. • Only a single, numeric key allowed. • Keys must map on to the range of the Relative Record numbers. • Fastest Direct Access organization. • Very littlestorage overhead. • Can be read sequentially. Disadvantages. Advantages.

  21. Indexed Files. • Slowest Direct Access organization. • Especially slow when adding or deleting records. • Not very storage efficient. Must store the Index records, the alternate Index records, the data records and the alternate data records. • Can use multiple, alphanumeric keys. • Can have duplicate alternate keys. • Can be read sequentially on any of its keys. • Can partially recover space from deleted records. Disadvantages. Advantages.

More Related