3 ms·
I usually remove db constraints and implement constrains at the application level for both types.
by wolco 8y ago
I usually remove db constraints and implement constrains at the application level for both types.
- tatersolid 8y agoWhen you remove constraints from an RDBMS you slow it down, sometimes catastrophically. The query planner/compiler in all modern RDBMS use foreign key constraints, unique constraints, and check constraints to optimize their execution code. For instance, having a foreign key constraint allows the query planner to omit any code that checks if a value is in the child table but not the parent during a join. It can sometimes avoid accessing one table or the other entirely (so-called “join elimination”).