Coskan’s Approach to Oracle

March 26, 2007

Do Primary/Unique Keys need Index??

Filed under: Basics — coskan @ 7:33 pm

Till 10 minutes ago I was thinking that primary key or unique key constraints always created with their indexes by default. But after reading Tables chapter of Expert Oracle Database Architecture: 9i and 10g Programming Techniques and Solution (book of Mr Kyte) all my thoughts changed.

He noted “A unique or primary key constraint may or may not create a new index. If there is an existing index on the constrained columns, and these columns are on the leading edge of the index, the constraint can and will use them.

Here is the proof of the note;

code_listing 7

References Used :

Expert Oracle Database Architecture: 9i and 10g Programming Techniques and Solution
(Pg 341)

All Test are done on 10.2.0.1 XE

About these ads

1 Comment »

  1. What do you mean ?

    Comment by music — January 30, 2008 @ 9:20 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 199 other followers

%d bloggers like this: