Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Re-enable foreign key constraint takes a long time

susieqJan 29 2018 — edited Jan 29 2018

I have two databases.  They both have the same schemas.  One is approx. 1GB and the other is approx. 10GB.  On both databases, there is a parent and child table with similar number of records (~300k records each).  From legacy code, the previous DBA disabled a foreign key constraint, did some INSERTs into the parent and child tables and then re-enabled the foreign key.  On the smaller database, this operation takes < 1 second.  On the larger database, this operation takes 1.5 minutes.  After timing each instruction, I narrowed it down to the re-enable causing the bottleneck, but I don't know exactly why it's <1 second on one instance and 1.5 minutes on the other.  I think it's due to the size.  But I'm not sure how to substantiate this to my manager.  I cannot use EXPLAIN PLAN.  Is there a way to quantify or determine what's causing the discrepancy in timing?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 26 2018
Added on Jan 29 2018
4 comments
1,236 views