Constraints identify the relationships in the data model that are used to create segments for the segmentation group.
Every table in a segmentation group that is not a driving table must have a constraint that identifies its relationship with the parent table. Add only the constraints that define the necessary relationships for segmentation.
For example, you want to create an Orders segmentation group with three tables named ORDERS, ORDERS_LINES, and ORDER_SHIPMENTS. You mark the ORDERS table as the driving table, ORDER_LINES as a child table of ORDERS, and ORDER_SHIPMENTS as a child table of ORDER_LINES. The application defined foreign keys in ORDER_SHIPMENTS to both of its parent tables, ORDERS and ORDER_LINES. When you create the constraints for smart partitioning, you use only one of the constraints to define the relationship.
Segmentation groups may have tables with multiple aliases. You must identify the constraints that exist between parent and child tables, as well as their aliases if they exist. For example, if the DOCUMENTS table is a child of both INVOICES_PARENT and CHECKS_PARENT, you must add the DOCUMENTS table to the model twice. The DOCUMENTS_1 alias has a constraint that associates the DOCUMENTS table to INVOICES_PARENT. The DOCUMENTS_2 alias has a constraint that associates the DOCUMENTS table with CHECKS_PARENT.
You can also add an expression to each constraint. Use an expression to restrict the rows in a child table to those that apply to the parent. For example, a general documents table could be referenced by many parents. The expression for a relationship to INVOICE_PARENT could be: