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: not null and indexes

Re: not null and indexes

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 13 Feb 2005 13:51:23 -0800
Message-ID: <118331483.00001146.024@drn.newsguy.com>


In article <420f9b25$0$16585$cc9e4d1f_at_news-text.dial.pipex.com>, Niall Litchfield says...
>
>"Malcolm Dew-Jones" <yf110_at_vtn1.victoria.tc.ca> wrote in message
>news:420f964e_at_news.victoria.tc.ca...
>> vertigo (ax178_at_wp.pl) wrote:
>> : Hello
>>
>> : Does oracle create automaticly indexes on not null columns ?
>>
>> No.
>>
>> But if you define constraints on a column then oracle may implement that
>> constraint using an index on the column.
>>
>> Prime example being a primary key - it must be unique and a unique index
>> is used to enforce that - so in that case those columns will be in an
>> index. Also in that case, the columns involved will end up being not null
>> columns.
>
>Isn't this the *only* such example. As such I'd view it as an exception.
>Incidentally if the column is already indexed (even with a non-unique key)
>then the index won't be created (and more to the point) dropped with the
>constraint.
>
>

well, there is that "unique" constraint as well :)

primary keys
unique constraints

they both will either utilize an existing index or create one -- either a unique or non-unqiue index as appropriate (for deferrable or nondeferrable constraints)....

-- 
Thomas Kyte
Oracle Public Sector
http://asktom.oracle.com/
opinions are my own and may not reflect those of Oracle Corporation
Received on Sun Feb 13 2005 - 15:51:23 CST

Original text of this message

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