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!

Proof that not null constraints on primary key columns are checked twice

130180Apr 9 2009 — edited Apr 9 2009
Hi

I am working on a table that has been created with not null check constraints on primary key columns.

I need to prove that not only is this not necessary, but whether the database checks this column twice.

I have created a test table with this issue, inserted a million rows and timed the run, then repeated with the check constraint disabled.

After running a few times, it is consistent that the constraint enabled run is about 70 seconds, as opposed to 60 seconds when disabled.

Although this helps, I don't think this is proof.

I traced the run and tkprof'd the output, but can't find reference to constraint checking in the report.

So, question:

Is there any way I can show for sure if Oracle is double checking the constraint?

Also:

Apart from self documentation, is there any other reason why these not null constraints were applied to PK columns? I can't think of one.......

Many thanks in advance

Chris
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2009
Added on Apr 9 2009
15 comments
1,043 views