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: db constraints evaluation question

Re: db constraints evaluation question

From: Joe Celko <71062.1056_at_compuserve.com>
Date: 2000/04/04
Message-ID: <8cblim$jat$1@nnrp1.deja.com>#1/1

>> When I do an update on x in a table y and if is there is a
constraint x<10 on the table, the transaction manager has to check that for updated row(s). If there is another constraint z>10, then checking that, would be a waste of time - given that the value of z doesn't depend on the one of x. <<

I think you find that the CHECK()clauses get added to the WHERE clause list of the query, insert, update and delete statements if possible. It is then up to the optimizer to prune unneeded predicates.

The problem is that a predicate in a WHERE clause that tests UNKNOWN rejects the row, while a CHECK() clause predicate that tests UNKNOWN accepts the row. The optimizer has to figure out if the predicate is 2VL or 3VL and handle it.

--CELKO--
Joe Celko, SQL and Database Consultant

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Apr 04 2000 - 00:00:00 CDT

Original text of this message

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