Getting Started as an MPE/iX Programmer Programmer's Guide: HP 3000 Computer MPE/iX Computer Systems > Chapter 7 Data ManagementTurboIMAGE/XL Data Base |
|
A database is a collection of logically related data in one or more files. The files contain both the data itself and structural information on how one piece of data relates to another. Pointers in the database allow access to the actual data and indexing across the multiple files in the database. A network database ties together fields containing information that may be relevant to a single transaction even though they physically reside in different records. The terminology used to describe a database differs from that used to describe MPE/iX files. Table 7-2 “Data Base Terminology” shows the corresponding terms. Table 7-2 Data Base Terminology
A network database consists of data sets. The structure of the database is a schema, which the user writes. The schema is processed and kept in a special file called a root file, which is also part of the database. The term database application refers to a complete data processing application using a database management system and a database. The database described in this chapter is a TurboIMAGE/XL data base. A TurboIMAGE/XL database has two types of data sets:
A given network database can have many detail sets and many master sets. A key data item is frequently called simply a key item. It uniquely identifies the related data entries in a master data set. A search item value is not necessarily unique. In a master set, a key item is the data item used to perform the search. Each master set entry contains a key item pointing to a subset of detail set entries, all with related values in a particular data item. Thus, you can quickly reference any subset of entries by finding its master key item (index pointer). Each master set can contain values for one detail data item to search. (In other words, it can have only one field as a key item.) However, each master set can provide indexing for a maximum of 16 detail sets by using a key item in the master set as an index for a maximum of 16 detail sets. Each detail set can be linked to 16 master sets and can contain a maximum of 16 searchable data items. A master set can be automatic or manual. In a master set data entry, the key item and the data items accompanying it are called a chain head. It consists of:
In the detail set, the first and last data entry described by the pointers in the chain head are the beginning and ending of the chain of data entries in the detail set that have the same value for the associated data item as the master set key item. A chain can have a maximum of 2**31 data entries. If more than one master set references a particular detail set, additional pointers are made available in the detail set. A chain can be searched in either a forward or backward direction. This is convenient, for example, in an application that adds new invoice numbers to an existing data set. Otherwise, you can follow the pointer directly to the last entry in the chain and add a new entry using a minimum of disc overhead. New entries are automatically added at the end of the chain, unless the chain is sorted. Although pointers occupy space, usually a database takes less space than the MPE/iX files it replaces. This is because the reduction in data redundancy can outweigh the internal overhead of maintaining a TurboIMAGE/XL database. Figure 7-4 “TurboIMAGE/XL Data Set Organization Example” shows an example of how chain heads in a master set are used in TurboIMAGE/XL data set organization. The characteristics of an automatic master set are:
A manual master set data entry can contain not only a key item, but additional data items that provide information in addition to the key item. The characteristics of a manual master set are:
|