As described in Chapter 7, "Overview of the IMS Hierarchical Database Model," on page 67, a segment represents one entity or grouping of related fields. In IMS, unlike DB2 or many other DBMSs, you do not have to define all of the fields to IMS. You must only define the segment as being long enough to contain all the application data to be stored. The only fields you must define to IMS are those that you need to use to identify and search for segments. Specifying non-search fields is optional. In addition to the application data, each segment contains control information that is used by IMS. The control information is placed at the beginning of the segment in a segment prefix. Figure 8-2 shows the layout of a segment with the prefix and application data portions. The prefix is automatically maintained by IMS and is not accessible to the application. The control information in the prefix consists of various flags, descriptive fields (segment type code and delete byte), and pointers to implement the hierarchical structure and access paths. The contents of the prefix will vary, depending on the IMS access method and options chosen when the database is defined.
The RBA pointers in Figure 8-2 consist of the relative offset (number of bytes) of the segment being pointed at, from the start of the data set being used to store the data. This is the relative byte address (RBA). For example, a root segment would contain pointer fields in the prefix for, at a minimum, all of the dependent segment types under the root. IMS will automatically define the minimum set of pointers to maintain the hierarchical structure. The database designer can also specify additional predefined types of pointers, in addition to those necessary for the minimum hierarchical structure. This pointer selection can influence the performance of applications using the databases. Figure 8-3 on page 86 shows database segments with their pointers: physical twin forward (PTF), physical twin backward (PTB), and physical child forward (PCF). Figure 8-3. Database Segments and Pointers
Physical Segment DesignWhen designing segments, the physical parameters are important. The following list discusses the details of these physical parameters.
|