Re: Declaring Unenforced Constraints

From: Kenneth Downs <firstinit.lastname_at_lastnameplusfam.net>
Date: Wed, 17 Nov 2004 06:45:32 -0500
Message-ID: <t7qr62-qd8.ln1_at_pluto.downsfam.net>


Laconic2 wrote:

> There's a feature I would like to see in today's RDBMSes. It's the
> ability
> to declare a constraint to be true, but to tell the DBMS not to bother
> enforcing it. I'm talking here about SQLRDBMSes, and probably TRDBMSes as
> well.
>
> So what's the point?
>
> Well, there are a lot of data architects who don't want the DBMS to
> enforce
> a constraint "for performance reasons". The merits of that argument vary
> widely from case to case, but there's some merit to it. It's particularly
> true if the data can be guaranteed to be "cleansed" by the transactions
> that write the data.
>
> 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.
>

As a late response, may I ask if you perhaps meant delayed enforcement? As in loading lots of data and then running some type of batch enforcement later on? Or do you mean a constraint that is not enforced at all ever?

In the first case, it seems that we are not so much un-enforcing as we are redefining a transaction. There are certain tables I have for a batch operation, which have no declared constraints on them, though they do have many unique and referential constraints that must be correct or I have garbage going in. The lack of declared constraints allows the data to be loaded in any order, such as children before parents. Just before it starts processing, it validates the entire set and reports all errors, if there are any. In this sense the transaction is considered all activities up to the request for processing.

Of course we'll need to hear from Tony on how this creates Dirty Reads in Oracle ;)

-- 
Kenneth Downs

java.lang.String.tcpip.usenet.posting.response.sigblock.setSig("After
finally finding the right object abd method to set the sig block, I forgot
what I wanted to say!");
Received on Wed Nov 17 2004 - 12:45:32 CET

Original text of this message