Page 114 - Accounting Information Systems
P. 114

CHAPT E R 2        Introduction to Transaction Processing  85


                         FI G U R E
                           2-37     SEQUENTIAL STORAGE AND ACCESS METHOD

                                                      Records Are Read Sequentially






                         Key                          Key                           Key
                         1874      Other Data         1875       Other Data         1876       Other Data








                                                        Keys Are in Sequence
                                                      (in this case, ascending order)


                       DIRECT ACCESS STRUCTURES
                       Direct access structures store data at a unique location, known as an address, on a hard disk or floppy
                       disk. The disk address is a numeric value that represents the cylinder, surface, and block location on the
                          4
                       disk. The operating system uses this address to store and retrieve the data record. Using our music anal-
                       ogy again, the direct access approach is similar to the way songs are stored on a compact disc. If the lis-
                       tener chooses, he or she can select a specific song directly without searching through all the other songs.
                           An important part of the direct access approach is in determining the disk address, which is based
                       on the record’s primary key. Bank account numbers, social security numbers, credit card numbers, and
                       license plate numbers are examples of primary keys that are translated into addresses to store and retrieve
                       data by different business applications. The following techniques are examples of data structures that
                       have direct access capability.


                       INDEXED STRUCTURE
                       An indexed structure is so named because, in addition to the actual data file, there exists a separate index that
                       is itself a file of record addresses. This index contains the numeric value of the physical disk storage location
                       (cylinder, surface, and record block) for each record in the associated data file. The data file itself may be
                       organized either sequentially or randomly. Figure 2-38 presents an example of an indexed random file.
                           Records in an indexed random file are dispersed throughout a disk without regard for their physical
                       proximity to other related records. In fact, records belonging to the same file may reside on different
                       disks. A record’s physical location is unimportant as long as the operating system software can find it
                       when needed. Searching the index for the desired key value, reading the corresponding storage location
                       (address), and then moving the disk read/write head to the address location accomplish this. When a new
                       record is added to the file, the data management software selects a vacant disk location, stores the record,
                       and adds the new address to the index.
                           The physical organization of the index itself may be either sequential (by key value) or random.
                       Random indexes are easier to maintain, in terms of adding records, because new key records are simply
                       added to the end of the index without regard to their sequence. Indexes in sequential order are more diffi-
                       cult to maintain because new record keys must be inserted between existing keys. One advantage of a se-
                       quential index is that it can be searched rapidly. Because of its logical arrangement, algorithms can be


                       4 For further explanation about disk addresses, see Section A of the Appendix to this chapter.
   109   110   111   112   113   114   115   116   117   118   119