Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Unique index vs. unique constraint

Re: Unique index vs. unique constraint

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Thu, 26 Aug 1999 11:38:52 +0200
Message-ID: <7q320l$asa$1@oceanite.cybercable.fr>


The difference is conceptual.
A unique index is only created for performance reason: to optimize the access to the data.
A unique constraint is defined for functionnal reason (even if it is implemented with a unique index): the datas of a (or a set of) column are to be unique ; more, you can define a foreign key on a unique constraint (not obviously on a unique index)...

Michael Hjorth a écrit dans le message <7q2vo5$c0g$1_at_nnrp1.deja.com>...
>What is the functional difference between a unique index and a unique
>constraint?
>I know the latter has a constraint as well as the index, but apparently
>it enforces the same restrictions on the database as the unique index.
>Or did I get it wrong?
>Why would I prefer one over the other in a particular case?
>
>Thank you for any comments.
>
>Michael.
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Thu Aug 26 1999 - 04:38:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US