Previous Topic: Bidirectional Virtual RelationshipNext Topic: Physical Databases


Bidirectional Physical Relationship

What is a Bidirectional Physical Relationship

Bidirectional physical relationships provide access in both directions between a logical parent segment and a logical child segment. In this respect, they are the same as bidirectional virtual relationships. The difference between the two types of relationships is that bidirectional physical employs a physical duplicate of the real logical child, while bidirectional virtual employs a pointer to the real logical child, with no duplication of data.

Using Physical or Logical Virtual Bidirectional Relationships

The decision to use one type of bidirectional relationship instead of another depends on whether you want to optimize performance or space usage. Bidirectional physical relationships provide faster access times, but incur more space overhead because of the duplicate logical child data. They also require more maintenance overhead since updates made to one logical child must be duplicated in the other. Bidirectional virtual relationships conserve on space, but provide slower access times.

Bidirectional Physical Structure

The illustration below shows the bidirectional physical relationship defined by the DBD source statements in Figure 7. In this relationship, SEG6 is a physical child for SEG5 and a logical child for SEG1, SEG4 is a physical child for SEG1 and a logical child for SEG5. Note that SEG6 and SEG5 are in DBD PHYSDB2, and SEG4 and SEG1 are in DBD PHYSDB1.

Figure 12. Bidirectional physical structure

Defining a Bidirectional Physical Relationship

To create a bidirectional physical relationship, you must define a child segment as both physical child and logical child for each parent, in each parent's physical hierarchy. In effect, you define the same unidirectional structure for each parent. The two logical child segments contain duplicate data and together are referred to as physically paired logical child segments. Note that the logical child SEGM statements cannot include the SOURCE parameter.