![]() ![]() It is very common to query the EMP table in the context of a deptno. O When you query from the PARENT to the CHILD. This full scan is probably undesirable and if you delete many rows from the parent table, the child table will be scanned once for each parent row deleted. If deptno in emp is not indexed, you will get a full table scan of EMP. ![]() Delete deptno = 10 should cascade to EMP. O When you have an on delete cascade and have not indexed the child table. In addition to the table lock issue that might hit you, an unindexed foreign key is bad in the following cases as well: See the tail of this answer for a script to detect unindexed foreign keys and pointers into the documentation as to the above referred to locking issue (which is real - table locks can arise if you delete a parent record or update the primary key of a parent record and have unindexed foreign keys). ![]()
0 Comments
Leave a Reply. |