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

Home -> Community -> Usenet -> c.d.o.server -> Re: Difference: Uniq. Constraint & Index ?

Re: Difference: Uniq. Constraint & Index ?

From: Mladen Gogala <mgogala.spam-me-not_at_verizon.net>
Date: Tue, 17 Oct 2006 04:00:00 GMT
Message-Id: <pan.2006.10.17.04.00.00.277350@verizon.net>


On Mon, 16 Oct 2006 19:58:31 -0400, klabu wrote:

> alter table my_emp
> add constraint u_con unique (col_a) ;
>
> create unique index u_index on my_emp (col_a);
>
> What is the difference between Unique Constraint and Unique Index ? And
> under what circumstance(s) will their difference come into play ?
>
>

Constraint is a metadata telling something about the nature of the column(s). Index is a physical structure which helps when accessing the table. The difference among the two stems from the difference in their role (metadata vs. physical access path aid). Any CASE tool or any sophisticated development tool (project dinosaur by Oracle, froggie by the Quest software and many others) are likely to read constraints and use them for creating logical table description. Furthermore, you cannot create foreign key referencing columns without primary or unique constraints. At this point I'd have to recommend the RTFM procedure for obtaining any further details. The FM in this case are the concepts manual and application developers guide for your database. I would also recommend not annoying Sybrand any more as he is likely to provide some good information if he's not cross with you. So, byte the bullet, do some reading and may the force be with you.

-- 
http://www.mladen-gogala.com
Received on Mon Oct 16 2006 - 23:00:00 CDT

Original text of this message

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