Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: performance when inserting into child tables
I have a child table with a formal foreign key relationship to its parent.
I have noticed that in alot of cases inserting into them is much slower
than inserting into the parent.
I didn't design the system, but all of these cases do not have the foreign
key indexed. I think that is the problem, but I'm not sure why. If it
needs to scan the parent table to see if a value exists it can do an index
scan on the primary key?
Anyone know more about this?
The lack of indexes for the FK's will cause a share lock to be taken out on the child table when ever the parent is deleted or updated.
This means that updates, deletes and inserts into the child must wait on the DML to the parent to complete.
Check your enqueue waits, they are likely somewhat excessive.
Jared
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.htmlReceived on Wed Apr 21 2004 - 12:58:56 CDT
-----------------------------------------------------------------
![]() |
![]() |