niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle
not null and indexes
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
Author Message
DA Morgan
*nix forums Guru


Joined: 06 Mar 2005
Posts: 1042

PostPosted: Thu Feb 17, 2005 3:46 pm    Post subject: Re: not null and indexes Reply with quote

vertigo wrote:

Quote:
Hello

Does oracle create automaticly indexes on not null columns ?

Thanx
Michal

No as Sybrand said but also Oracle does not index NULLs.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace 'x' with 'u' to respond)
Back to top
Thomas Kyte
*nix forums addict


Joined: 03 May 2005
Posts: 62

PostPosted: Sun Feb 13, 2005 8:51 pm    Post subject: Re: not null and indexes Reply with quote

In article <420f9b25$0$16585$cc9e4d1f@news-text.dial.pipex.com>, Niall
Litchfield says...
Quote:

"Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
news:420f964e@news.victoria.tc.ca...
vertigo (ax178@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
Back to top
Mark C. Stock
*nix forums Guru


Joined: 05 May 2005
Posts: 730

PostPosted: Sun Feb 13, 2005 8:50 pm    Post subject: Re: not null and indexes Reply with quote

"Niall Litchfield" <niall.litchfield@dial.pipex.com> wrote in message
news:420f9b25$0$16585$cc9e4d1f@news-text.dial.pipex.com...
Quote:
"Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
news:420f964e@news.victoria.tc.ca...
vertigo (ax178@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.


--
Niall Litchfield
Oracle DBA
http://www.niall.litchfield.dial.pipex.com


Good addtional regarding the pre-existing index.

Clarification for those not familiar with this -- the behavior described
above is true for both PRIMARY KEY and UNIQUE constraints, but no other
constraints (i.e., not for CHECK, FOREIGN KEY REFERENCES or NOT NULL)

++ mcs
Back to top
Niall Litchfield
*nix forums Guru Wannabe


Joined: 29 Apr 2005
Posts: 128

PostPosted: Sun Feb 13, 2005 5:23 pm    Post subject: Re: not null and indexes Reply with quote

"Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
news:420f964e@news.victoria.tc.ca...
Quote:
vertigo (ax178@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.


--
Niall Litchfield
Oracle DBA
http://www.niall.litchfield.dial.pipex.com
Back to top
Malcolm Dew-Jones
*nix forums Guru


Joined: 04 Mar 2005
Posts: 418

PostPosted: Sun Feb 13, 2005 5:02 pm    Post subject: Re: not null and indexes Reply with quote

vertigo (ax178@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.




--

This space not for rent.
Back to top
Sybrand Bakker
*nix forums Guru


Joined: 03 Apr 2005
Posts: 1766

PostPosted: Sun Feb 13, 2005 10:58 am    Post subject: Re: not null and indexes Reply with quote

On Sun, 13 Feb 2005 12:41:07 +0100, vertigo <ax178@wp.pl> wrote:

Quote:
Hello

Does oracle create automaticly indexes on not null columns ?

Thanx
Michal

No


--
Sybrand Bakker, Senior Oracle DBA
Back to top
vertigo
*nix forums addict


Joined: 23 Mar 2005
Posts: 71

PostPosted: Sun Feb 13, 2005 10:41 am    Post subject: not null and indexes Reply with quote

Hello

Does oracle create automaticly indexes on not null columns ?

Thanx
Michal
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 3:33 am | All times are GMT
navigation Forum index » Databases » Oracle
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts "CHARACTER SET COLLATE NULL" error with mySQL 4.0.27 thomas Armstrong MySQL 1 Thu Jul 20, 2006 9:11 am
No new posts 2.6S1 - assertion failed: authenticate.c:836: "auth_user_... Covington, Chris Squid 1 Tue Jul 18, 2006 2:16 pm
No new posts Null reference David White C++ 27 Tue Jul 18, 2006 5:17 am
No new posts Calling functions - NULL vs default snarks@gmail.com Oracle 3 Mon Jul 17, 2006 9:32 am
No new posts NULL vs 127.0.0.1 passed to milter for connections from l... April Lorenzen Postfix 2 Sun Jul 16, 2006 4:47 pm

Credit Report | Neopets Cheats, Games and Neopoints | Debt Consolidation | Credit Card | Web Advertising
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1963s ][ Queries: 20 (0.0881s) ][ GZIP on - Debug on ]