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: Subquery in constraints...

Re: Subquery in constraints...

From: Vadim Tropashko <vadimtro_at_yho.cm>
Date: Mon, 11 Oct 2004 12:38:57 -0700
Message-ID: <mxBad.44$UF1.123@news.oracle.com>


Mikito Harakiri wrote:
> Suppose you implement foreign key constraint as a subquery in the check
> constraint clause. Would the DBMS be smart enough to leverage existing index
> on the parent_id column?

What is so difficult about it? Checking if parent record exist is just a [recursive] query. SQL optimiser must be perfectly able to decide whether to use index or not. Received on Mon Oct 11 2004 - 14:38:57 CDT

Original text of this message

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