I have (among other things) a parent table with 200 records and a child table with 
20MM or more. I set up referential integrity on the FK with ON DELETE CASCADE.

It appears that when a DELETE is done on the parent table, the child table deletion is done with a sequential scan. I say this because it took over four minutes to delete a parent record THAT HAD NO CHILDREN. The DB is recently analyzed and SELECTs in the child table are done by the appropriate index on the FK.

Do you have an index on the foreign key field?


---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend

Reply via email to