Skip to Main Content

SQL & PL/SQL

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Does adding a PK constraint wo a "using index" automatically create an index

rjsosiSep 28 2021

Hi ,
We're using Oracle 12c.
We dropped and recreated a Primary Key (PK) Constraint. using the following:

alter table table_name add constraint constraint_name primary key (col1, col2, col3)
enable novalidate;

There was already a PK Index there from the previous PK constraint. It looks like it created an additional PK index.
Was that because we didn't specify "USING INDEX" in the ALTER statement?
So in other words does creating a PK Constraint automatically create a PK Index, even if a PK Index already exists, if you don't specify "USING INDEX" in the ALTER statement?

This post has been answered by mathguy on Sep 28 2021
Jump to Answer

Comments

Post Details

Added on Sep 28 2021
10 comments
6,265 views