In the exercise, you will analyze the SAMP schema in the physical
data model to check for compliance with foreign key index rules. You can use
the model analysis feature in the workbench to check for compliance with various
rules and rule categories, including naming standards and SQL syntax.
You can analyze the following data objects for compliance:
- A database or schema in a physical data model
- A package in a logical data model
- A database or schema in a database connection in the Database Explorer
To analyze the SAMP schema in the physical data model:
- Right-click the schema SAMP in the Data Project Explorer and select Analyze
Model.
- In the window that opens, clear all check boxes in the Rule
categories list except Index and storage.
- In the Rules list, clear all check boxes
except Foreign key index check.
- Click Finish. In the Problems
view, warnings are displayed. For example, "Foreign key EMPLOYEE_DEPARTMENT_FK
in table EMPLOYEE does not have an index". You can navigate from problems
in the Problems view to the corresponding object in a diagram or the Data
Project Explorer. For example, you can navigate to the EMPLOYEE_DEPARTMENT_FK
column to fix the problem by adding an index to this column.
- Double-click the warning message in the Problems view. The
EMPLOYEE_DEPARTMENT_FK column is highlighted in the Data Project Explorer.
- Right-click the EMPLOYEE_DEPARTMENT_FK column, and select . A new index named EMPLOYEE_WORKDEPT_IDX is created and displayed
in the Data Project Explorer.
- Highlight EMPLOYEE_WORKDEPT_IDX in the Data Project Explorer, click
the Details tab in the Properties view, and verify that the index is using
the WORKDEPT column. You can repeat the steps for each foreign key that does
not have an index. Now, save the sample_model physical data model file to
save your changes.
- Click from the main menu bar.
Your changes are saved to the model file.