4 ms·
When you remove constraints from an RDBMS you slow it down, sometimes catastrophically. The query planner/compiler in all modern RDBMS use foreign key constrai
by tatersolid 8y ago
When 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”).