Databases Reference
In-Depth Information
a
C1
C2
O11
O12
S34
O21
S36
S41
1;5
2;2
2;2
1;3
1;O11;1;5
2;O11;2;2
3;O12;1;3
1;9
2;2
3;5
1;O21;1;6
2;O21;2;2
1;O21;1;3
2;O21;3;5
P2
P8
P2
P2
P8
P2
P3
P7
P8
P3
P7
P3
P8
C1
C2
b
O11
O12
O21
1;5
2;2
1;3
1;9
2;2
3;5
P2
S34
P8
S34
P2
S34
P3
S36
S41
P7
S36
P8
S41
1;5
2;2
3;3
1;6
1;3
2;2
2;5
P2
P8
P2
P3
P3
P7
P8
Fig. 2.4 Example hierarchy instances for the customer order hierarchy. ( a ) No order/shipment
mapping. ( b ) Direct mapping of shipments to order lines
Figure 2.4 exemplifies the aforementioned alternatives for the hierarchical
customer order hierarchy. Nodes in the hierarchical model are instances of entities,
e.g., a customer named
C1
. Listing 2.1 presents the orders and shipments depicted
in Fig. 2.4 . Two customers
C1
and
C2
place orders for the products
P2;P3;P7;
and
. The numbers provided in the order lines and shipment lines represent the
ordered and shipped quantities.
The different modeling alternatives introduce differing levels of redundancy.
While in the alternative in Fig. 2.4 a only the product instances are repeated and
an overview of complete orders and shipments per customer is simply achieved
by scanning the respective subtrees, the alternative in Fig. 2.4 b stores redundant
shipment data for each order line besides the redundant product data, but it simplifies
queries associating order lines with their shipments. For example, it is easy to
determine that the order for product
P8
P3
of customer
C2
is split across two
shipments, that is,
, but to analyze the contents of an entire shipment,
a scan of the complete subtree of this customer is needed.
Logical relationships were added in IMS/360 2.0 to efficiently handle many-
to-many relationships [ 138 ]. They interrelate segments from different physical
hierarchies building a logical hierarchy. Logically connected physical hierarchies
may constitute a network data structure, although application data is still stored in
one or more physical hierarchies [ 132 ]. Concerning the previous example, logical
relationships can help to avoid the redundant storage of product records: An own
hierarchy for products can be introduced and logical paths from the order line
records of the customer order hierarchy to these product records can be created.
S36
and
S41
 
Search WWH ::




Custom Search