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: unique contraint without index

Re: unique contraint without index

From: William Robertson <williamr2019_at_googlemail.com>
Date: 16 Jan 2007 02:18:12 -0800
Message-ID: <1168942692.203980.166580@q2g2000cwa.googlegroups.com>


Taral wrote:
> Yes, you can create unique constraint on this two column and will not
> create unique index
>
> ALTER TABLE table_name
> add CONSTRAINT constraint_name UNIQUE (column1, column2, ... column_n);
>
>
> On Jan 16, 12:07 pm, "oracle dba" <aoracle..._at_gmail.com> wrote:
> > hi all,
> > In my database I don't want any index on three columns (a,b and c) I
> > need unique contraint on three columns, so that value will not repeat.
> > Is it possible.
> > And if no, then unique key is better or primary key for space usage
> > prospective. Or if YES then pls tell me how.

That only avoids a *unique* index, The OP wanted to avoid having any index at all, which is not possible.

Regarding the space usage, unique and non-unique indexes use exactly the same amount of space.

I suppose making it an index-organized table would save space, though bear in mind that these are not good for bulk loads because you can't mark the index unusable, and IIRC there are some partition exchange operations they don't support. Of course these may not be an issue here. Received on Tue Jan 16 2007 - 04:18:12 CST

Original text of this message

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