Collapse relationships
You can eliminate unnecessary entities by embedding their data in a related entity type. By using a repeating data element instead of maintaining two separate entities, you can save storage space and also reduce CPU needed to access the repeating data as described below:
Thus we can eliminate the PHONE entity and place three PHONE NUMBER data elements in the OFFICE entity. We can also eliminate the SALARY GRADE entity and place four SALARY GRADE data elements in the JOB entity. If you define this database using SQL statements, each of the repeating data elements must have a unique name and, in the case of PHONE NUMBER and SALARY GRADE, allow null values.
Introduce redundancy
The PHYSICIAN, HOSPITAL, PATIENT, DENTIST, and INS CO entities are never processed independently of other entity types. Therefore, they do not need to be maintained independently in the database. In addition, information in the PROJECT and WORKER entities is already carried in the STRUCTURE entity. HEALTH INS PLAN and LIFE INS PLAN contain the same type of information and can be combined into a single entity. Information maintained in these entities can therefore be embedded in other related entities:
Update anomalies for these entities will not present a problem for the organization. For example, since Commonweather users do not process DENTIST information by itself, inconsistent information in this entity will not compromise integrity or complicate business processing functions.
Eliminate unnecessary relationships
At this point, the health-related entities can be represented as:
The LIFE-PLAN relationship can be eliminated by treating it as another type of coverage available through an insurance plan. Although this change will require that an occurrence of COVERAGE be associated with each EMPLOYEE, it simplifies the database structure and the application processing.
The HIP-COVERAGE relationship can be eliminated also. Since there will never be more than 15 insurance plans in the database, the validity of an employee's insurance information (the plan code) can be enforced through other means such as a logical record facility path or an SQL CHECK constraint.
Also eliminate the DEPT-HEAD relationship. Integrity enforcement by the DBMS for this one-to-one relationship is not critical to Commonweather Corporation.
Add indexes
Add the following indexes to enforce unique constraints:
Note: You will see in the next chapter how some of these indexes can be eliminated.
Add the following indexes to provide generic search capability:
Refined data structure diagram
Copyright © 2014 CA.
All rights reserved.
|
|