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

Home -> Community -> Usenet -> comp.databases.theory -> Re: Declaring Unenforced Constraints

Re: Declaring Unenforced Constraints

From: Tony Andrews <andrewst_at_onetel.com>
Date: 5 Nov 2004 07:50:15 -0800
Message-ID: <1099669815.335252.204430@z14g2000cwz.googlegroups.com>


Laconic2 wrote:
> Is it possible to do such a thing? sure. Present day RDBMSes have a
> feature that declares an index "inactive", meaning that it still
exists,
> and it's definition is still there, but updates don't have to update
the
> index, at least not right now. You could do the same thing with
> constraints.

Oracle already does this. Quote from the Oracle Data Warehousing Guide:
<QUOTE>
ALTER TABLE sales ADD CONSTRAINT sales_time_fk FOREIGN KEY (time_id) REFERENCES times (time_id) RELY DISABLE NOVALIDATE; This statement assumes that the primary key is in the RELY state. RELY constraints, even though they are not used for data validation, can:

Creating a RELY constraint is inexpensive and does not impose any overhead during DML or load. Because the constraint is not being validated, no data processing is necessary to create it. </QUOTE>

The 3 keywords have meanings as follows:

RELY: assume that the constraint holds true when performing query re-writes

DISABLE: do not enforce the constraint for new data

NOVALIDATE: do not fail to create the constraint if it is violated by existing data Received on Fri Nov 05 2004 - 09:50:15 CST

Original text of this message

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