Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Unique Index or Constraint??

Re: Unique Index or Constraint??

From: sundeep maini <sundeep_maini_at_yahoo.com>
Date: Fri, 01 Jun 2001 09:18:24 -0700
Message-ID: <F001.00317BDC.20010601064608@fatcity.com>

Vishak,

Unique constraints by default leads to creation of a unique index by Oracle. This index is used for imposing uniqueness. If you have a unique index in mind then constraint is the way to go.

  1. An explicit constraint allows you to use Oracle mechanisms to trap exceptions in another table while ENABLEing a previously disabled constraint or trap errors in your code.
  2. Optimizer can make use of constraint declarations for query rewrite.
  3. If you are 8i you can define a unique constraint in DISABLEd VALIDATE mode and have Oracle skip the automatic creation of Index. If you are a datawarehouse environment you can still have the optimizer make use of the constraint for query rewite even if the index is not there.
  4. Constraint declaration gives you lots of flexibility on when to kick in the check. For OLTP environment you can defer constraint checks depending on your transaction's needs (in 8i).

There is gobs of information in the SQL ref manual on syntax and the options I have mentioned above.

HTH
- Sundeep



PS: I used to work for Wipro in 1987. I am wondering if the likes of Ashok Soota and Manoj Chug are still part of the company. You can send me email at my personal email address.
Thanks

Sundeep Maini
Consultant
Currently on Assignement at Marshfield Clinic WI mainis_at_mfldclin.edu



Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: sundeep maini
  INET: sundeep_maini_at_yahoo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Jun 01 2001 - 11:18:24 CDT

Original text of this message

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