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_at_news.oracle.com>
Date: Mon, 11 Oct 2004 12:38:57 -0700
Message-ID: <mxBad.44$UF1.123_at_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 - 21:38:57 CEST