Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Unique Constraint vs Unique Index
>I am a newbie and determining on which methods (unique constraint or
>unique index) would be better for a Data WH design.
>Should there be any difference between a unique constraint or purely
>unique index applied except for enabling/disabling constraint?
>Also, what will be the internal engine done if a constraint is applied?
I myself have never truly understood the difference. I do know that if you declare a unique constraint, Oracle creates an index for you. This index is used to ensure the uniqueness of the attribute values. If you create an index on a column and declare it to be unique, it does the same thing. I guess it's just two different ways of accomplishing the same thing. If you need to drop the index (and recreate it) then I would use the unique index option. That way I know the name of the index. (although it's not too hard to find the index created for a unique constraint).
Hope that helps,
Brian Peasland
peasland_at_msn.com
Received on Sat Jun 05 1999 - 17:08:00 CDT
![]() |
![]() |