Skip to content

Why auxiliary relations are needed

Suppose you have the following pattern in a logical data model:
Overlapping keys in logical data model

Notice that in table AB the primary key a, b and the foreign key a, c overlap as they both contain column a. Therefore, the value of a in the primary key a, b must be equal to the value of a in the foreign key a,c.

After creating a central facts model, the generated generic access model will look like this:
generated generic data access model

Notice that:

  • all three tables have a surrogate id column (coming from the Anchor ID column) as their primary key
  • foreign keys are also replaced by surrogate keys

What happened is that the logical model with natural keys has been transformed to a new model where all the tables have a new surrogate key which becomes the primary key. The original natural key becomes an alternate key.

Because of the surrogate key, it is now possible to have a record in table AB with a primary key value (A_id, b) and a foreign key value AC_id, where AC_id refers to the natural key value (A_id2, c). But this violates the constraints of the logical model since the values of A_id and A_id2 must be the same according to the foreign key constraint AB_AC in the logical model!

This is where the auxiliary subset constraints come in. If you add auxiliary relations to the entities in the generic access model, the following happens:

  • It adds the natural key column a of the primary key (a, b) ) as an Auxiliary column to table AB, and creates a second alternate key on the natural key (a,b)
  • It adds the natural key column a of the primary key (a, c) as an Auxiliary column to table AC, and creates a second alternate key on the natural key (a,c)
  • It adds the natural key column c of the foreign key AB→AC as an Auxiliary column to table AB
  • It creates an Auxiliary Subset Reference from columns (a,c) of table AB to columns (a,c) of table AC; this declares the lost subset constraint of the logical model

We now have the following "extended" generic access model:
Extended generic access model

Notice that:

  • table AB has two additional auxiliary columns a and c, table AC one additional auxiliary column a
  • there is an additional auxiliary subset reference from table AB to table AC.

Info

Table AB in the above model is in fact the OASI Business Key view of entity AB with the natural primary key (a,b) and the natural foreign key (a,c) from the logical model.