In rare situations, the application program has to have control over an entity's placement in the database. If the application programmer must be able to identify explicitly the location of entity occurrences in the database, you should assign the direct location mode to the entity type. This location mode provides programmers with rapid access to database entities and allows them to control the clustering of entities.
Store entities chronologically
Use direct location mode to store entities chronologically. The direct location mode can be used to arrange entity occurrences serially in a database area. The programmer can arrange entities serially by instructing CA IDMS/DB to store each entity on the same page as the preceding entity. CA IDMS/DB either stores the entity on the same page or on the next page(s), as space availability permits.
Ensure effective clustering
Use the direct location mode to ensure effective clustering. If a child entity has two different parent entities, you may want to take responsibility for clustering occurrences of the child entity. Suppose occurrences of entity C are related to an occurrence of entity A in some instances and by an occurrence of entity B in other instances. You would need to be able to cluster each occurrence of C with its appropriate parent entity (an occurrence of either A or B).
You can achieve effective clustering in this situation by assigning the direct location mode to entity C and the OM (optional manual) membership option to both relationships. Whenever a C entity occurrence must be stored in the database, the application programmer can then connect the entity to its appropriate relationship and cluster the entity with its parent.
For more information on membership options, see "Membership Options" later in this chapter.
However, you should also plan on writing your own unload and reload program for the C entity, since the DBMS does not know how to locate C entities.
Considerations
If the direct location mode is chosen, the entity should either be a child in a relationship or have an index defined on it. If neither of these is true, the only method to access an occurrence is through an area sweep. In most cases, clustering around an index or a relationship is a better storage strategy.
Representing the direct location mode
Represent the direct location mode on the data structure diagram by specifying DIRECT for the location mode. Do not name a CALC key or a relationship.
Copyright © 2014 CA.
All rights reserved.
|
|