Hellooo,
I was just wondering on the benefits of having a Primary Key as well as a unique index in a table.
I know that when you create a Primary Key, a Unique (Clustered <- which I'm not sure what this is) Index is automatically created so the Key can be enforced. According to this thread:
thread183-372027
the clustered index is only created so long as a unique clustered index doesn't already exist for that table with the primary key columns. Since that was an SQL Server forum does this hold true for Oracle?
The thread also says not to have more than one index because it slows down insert/update and takes up more space.
So is it possible to create my own unique index and then set the primary key up, assuming that it won't bother to create an index because my one already exists? Meaning that there is only one index so no disadvantage.
And if this is possible, is it a good thing to do?
Cheers,
Pete
I was just wondering on the benefits of having a Primary Key as well as a unique index in a table.
I know that when you create a Primary Key, a Unique (Clustered <- which I'm not sure what this is) Index is automatically created so the Key can be enforced. According to this thread:
thread183-372027
the clustered index is only created so long as a unique clustered index doesn't already exist for that table with the primary key columns. Since that was an SQL Server forum does this hold true for Oracle?
The thread also says not to have more than one index because it slows down insert/update and takes up more space.
So is it possible to create my own unique index and then set the primary key up, assuming that it won't bother to create an index because my one already exists? Meaning that there is only one index so no disadvantage.
And if this is possible, is it a good thing to do?
Cheers,
Pete