Create an Index for all FK Columns in the database
Generating indexes for all foreign key constraints in the database
Most of the time I have seen database foreign key constraints on tables without indexes on those columns. Lets say the application is trying to delete a row from the CUSTOMER table
DELETE FROM CUSTOMER WHERE CUSTOMERID = 1000; When the database goes about deleting the customerId of 1000, if there are foreign key constraints defined on customerId, then the database is going to try to find if the customerId of 1000 is used in any of those tables.
Posted by Pramod Sadalage on Thursday, September 3, 2009