Previous Topic: Segments - The Basic Unit Of DataNext Topic: Root Segments and Database Records


Hierarchies - Physical Relationships Between Segments

What Hierarchical Relationships Do

In DL/I, segments are related physically in terms of parent/child hierarchies. These hierarchical relationships determine the physical organization of a database. They control how segments are stored in relation to each other. They also define the access paths for getting from one segment to another. In a hierarchical (physical) relationship, the parent segment is referred to as the physical parent, and the child segment is referred to as the physical child.

Parent and Child Segments

A parent segment can have zero, one, or more child segments, but a child segment can have only one parent. Each occurrence of a parent segment can have any number of occurrences of a dependent child segment. For example, if employee Bob Jones has two skills, there will be two occurrences of the SKILL child segment for the one occurrence of the EMPLOYEE parent segment.

Parent and Child Occurrences

A child occurrence requires an existing parent occurrence, but a parent occurrence does not require a child occurrence. Two or more child segment occurrences that have the same parent occurrence in a hierarchy are referred to as physical twins. Such occurrences are twins only in the sense that they have the same parent occurrence ── not that they contain duplicate data.