Re: orace sql query
- From: DA Morgan <damorgan@xxxxxxxxx>
- Date: Sat, 23 Jun 2007 11:10:00 -0700
fitzjarrell@xxxxxxx wrote:
On Jun 22, 3:45 pm, DA Morgan <damor...@xxxxxxxxx> wrote:EdStevens wrote:On Jun 22, 12:15 pm, sathishkes...@xxxxxxxxx wrote:Not with an index. Indexes have nothing to do with primary keyi want to create table with primary key but with out indexHow do you think Oracle enforces the PK?
enforcement. Consider, for example, a deferred constraint which
is built with a non-unique index.
--
Daniel A. Morgan
University of Washington
damor...@xxxxxxxxxxxxxxxx (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org
From the documentation:
"Oracle enforces all PRIMARY KEY constraints using indexes.
To the best of my knowledge the document is incorrect.
The index is used to speed the search for a duplicate value ... not
to enforce it.
I will gladly stand corrected on this if someone has reason to
believe otherwise but were that not true you could not enforce
uniqueness with a non-unique index.
I didn't find the support I wanted in the time I have available
right now but let me quote from Tom Kyte:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3051352977204
=========================================================================
"The relationship between indexes and constraints is:
o a constraint MIGHT create an index or use an existing index to efficient[ly] enforce itself. For example, a PRIMARY KEY constraint will either create an index (unique or non-unique depending) or it will find an existing suitable index and use it.
o an index has nothing to do with a constraint. An index is an index.
So, a constraint MIGHT create/use and index. An INDEX is an INDEX, nothing more, nothing less."
=========================================================================
Please send me the link to the document in question. Thanks.
--
Daniel A. Morgan
University of Washington
damorgan@xxxxxxxxxxxxxxxx (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
.
- Follow-Ups:
- Re: orace sql query
- From: Charles Hooper
- Re: orace sql query
- From: Frank van Bortel
- Re: orace sql query
- References:
- orace sql query
- From: sathishkesani
- Re: orace sql query
- From: EdStevens
- Re: orace sql query
- From: DA Morgan
- Re: orace sql query
- From: fitzjarrell@xxxxxxx
- orace sql query
- Prev by Date: Re: orace sql query
- Next by Date: Re: orace sql query
- Previous by thread: Re: orace sql query
- Next by thread: Re: orace sql query
- Index(es):
Relevant Pages
|