Re: Using FKs to non PK unique-indexes
Date: 10 Feb 2006 10:11:50 -0800
Message-ID: <1139595110.796090.226540_at_z14g2000cwz.googlegroups.com>
thank you for your comment Jan ... there are some other elements I
would like to add :
For example, in the ORDERS table, we could have a column named
"workOrderID" to create a unique number to be used by the manufacturer
employees for executing any work related to what have been ordered.
This attribute would constitute another case of uniticy within the
ORDERS entity and would be entirely related to the PK, therefore
avoiding conflict with 2NF and 3NF.
So the question is still opened .... does MSSQL violates database
relational theory by allowing multi-unicities on an entity? I always
learned that an entity should have a single PK elected from the
different candidates.
I understand the need of having indexes on tables (I use them a lot for
optimization purposes) but I got very surprised to find out I could use
them to point out my FKs.
3- Triggers vs unique-index
Beside that, they are not easy to debug, they expose poor capacities
beside a true programming language and they can add considerable
overhead to queries.
In our case, considering the design is not normalized, triggers would
probably be the unique way to reach a normalized model while being sure
that data are consistant in the ORDERS_PRODUCTS table. I am almost
certain though that triggers would generate here more overhead than
having an additional column part of the FK between ORDERS and
ORDERS_PRODUCTS.
But on an other hand, I think it's the perfect example that
normalization should really not be considered as a dogma. I am always
amused to see people seeing a not-normalized schema as a sign of poor
design quality.
Received on Fri Feb 10 2006 - 19:11:50 CET