Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: What makes difference by creating an index or add a primary key to a table
Ed prochak wrote:
> cschang <cschang_at_maxinter.net> wrote in message news:<3F37065E.39ABB2B5_at_maxinter.net>...
> > Daniel:
> > I have searched such subject on the web. Many concluded the same thing
> > as you mentioned, but not much about the performance comparsion. According
> > to the closest conclusion, does that mean I only need to create an index (
> > or indexes) for speedy performance and I can ignore to create the primary key
> > constraint provided that I do not care about the null value of the primary
> > key. Besides, there is never be NULL to both column in my case, so whether
> > or not the parimary key by two columns does not matter. I did found a
> > response that claimed to be faster with the primary key verse the index (very
> > similar case as my, but it is on SQL server). That's what I consern.
> >
>
> Passing along something I learned recently in comp.databases:
> while I think ORACLE has supported multicolumn Primary keys where
> part of the key value (one or more columns) may be NULL, the SQL
> standard does not allow this. So to avoid possible problems in the
> future, you may want to rethink your choice for primary key columns.
>
> As far as a primay key being faster than an index, that would seem to
> be impossible on ORACLE, since ORACLE creates an index with the
> Primary key.
>
> HTH,
> ed
Oracle has never allowed a NULL in any primary key constraint.
-- Daniel Morgan http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Mon Aug 11 2003 - 19:10:49 CDT