1 / 14

Data Structures

Data Structures. Index Sequential Files. Learning Objectives. Explain Indexed Sequential Searches. Access Methods to Data. Computers can store large volumes of data. The difficulty is to be able to get it back.

Télécharger la présentation

Data Structures

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. Data Structures Index Sequential Files

  2. Learning Objectives • Explain IndexedSequential Searches.

  3. Access Methods to Data • Computers can store large volumes of data. • The difficulty is to be able to get it back. • In order to be able to retrieve data it must be stored in some sort of order. • There are a number of ways of arranging the data that will aid access under different circumstances.

  4. Batch Processing Examples • Printing out statements or bills for all customers. • Printing out pay slips for all workers.

  5. SequentialVRandom Advantage: Fast and immediate direct access because application of a hashing algorithm on the unique field of a particular record gives exact address of the record. Disadvantage: No order so unsuitable for batch processing as records could be missed out because there is no concept of a first or last record. Advantage: Logically ordered so suitable for batch processing as no records can be missed Disadvantage: Only approximate location of a particular record can be found so slow access. Sequential Access Files Random Access Files Increasing Search Speed for a particular record.

  6. Batch Processing and Fast Access • If we want a file which requires batch processing and fairly fast immediate direct access then we use … • See next slide.

  7. Indexed sequential Access File • A sequential file split up by using indexing into what amounts to a number of smaller sequential files.

  8. Indexed sequential Access • Data is accessed sequentially but is indexed. • e.g. Looking up names and numbers in a phone book. • To look up Jawad, a J is found in the table which gives the page number 232, the search is then started at page 232 (where all the Js will be stored). • Faster than ‘normal’ sequential access as the computer knows exactly where to start looking.

  9. Indexed sequential Access File Example

  10. Indexed sequential Access File Example • The account numbers for a bank’s customers are used as the key to access the customer accounts. • The accounts are held sequentially and there are approximately 10 million accounts. • There are 7 digits in an account number. • Indexes could be set up which identify the first two digits in an account number. • Dependent on the result of this first index search, there is a new index for the next two digits, which then points to all the account numbers, held in order, that have those first four digits.

  11. Indexed sequential Access File Example • There will be one index at the first level, but each entry in there will have its own index at the second level, so there will be 100 indexes at the second level. • Each of these indexes will have 100 options to point to, so there will be 10,000 blocks of data records. • But each block of records will only have a maximum of 1000 records in it, so adding a new record in the right place is now manageable which it would not have been if the 1million records were all stored together.

  12. Indexed Sequential Access Files Used: • Faster access than ‘normal’ sequential access and suitable for batch processing.

  13. Plenary • Explain IndexedSequential searches.

  14. Plenary • IndexedSequential Access • Data is accessed sequentially but is indexed.

More Related