Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 76404 invoked from network); 18 Mar 2007 04:08:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Mar 2007 04:08:57 -0000 Received: (qmail 60879 invoked by uid 500); 18 Mar 2007 04:09:04 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 60844 invoked by uid 500); 18 Mar 2007 04:09:04 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 60833 invoked by uid 99); 18 Mar 2007 04:09:03 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Mar 2007 21:09:03 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of msatoor@gmail.com designates 209.85.132.246 as permitted sender) Received: from [209.85.132.246] (HELO an-out-0708.google.com) (209.85.132.246) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Mar 2007 21:08:54 -0700 Received: by an-out-0708.google.com with SMTP id c25so819743ana for ; Sat, 17 Mar 2007 21:08:33 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Q69qkopBjgLcurti/s+q2+VjjhaLl79QZPRl9J3tcC8U1ISYSbVlA52gePmQCba3vNygeV2u28Y+hsgFKPDdPLnpFbbTNO1LY8P4UXsjL8QjcQLUoRjbKC90N3bxXz+oHqOm/Mb1pw6ehSGnTplSLYrF5MtPBD3C2XotxOSeTvg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=toGS5Lnq/qXC/2mF0xrmrsx4ZfvyyCRo6EkA1VBtrkyFKkhDOItvwyrIIWwq2ndI0u/0IfDwQBRyFj6IyMFc6Wf+MewVvyIuU8QVj15t0pKqJC1GUEcaEdOGWLXEWSuhbmyaFe7+h1ZZSWKTU1xPsSs/iCyk8wHnW6upsL47qyw= Received: by 10.100.133.9 with SMTP id g9mr2702001and.1174190913675; Sat, 17 Mar 2007 21:08:33 -0700 (PDT) Received: by 10.100.189.9 with HTTP; Sat, 17 Mar 2007 21:08:33 -0700 (PDT) Message-ID: Date: Sat, 17 Mar 2007 21:08:33 -0700 From: "Mamta Satoor" To: "Derby Discussion" Subject: Re: Foreign key -- implicit index? In-Reply-To: <1422022837.11271174154420656.JavaMail.root@dogfood.liquidsys.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_103368_13750450.1174190913637" References: <1422022837.11271174154420656.JavaMail.root@dogfood.liquidsys.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_103368_13750450.1174190913637 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Yes, that is correct. Copied following from the CREATE INDEX page in Derby's documentation Unique, primary key, and foreign key constraints generate indexes that enforce or "back" the constraint (and are thus sometimes called *backing indexes*). Mamta On 3/17/07, Dan Karp wrote: > > Just to make sure, this foreign key declaration > > CONSTRAINT fk_mail_item_parent_id FOREIGN KEY (mailbox_id, parent_id) > REFERENCES ${DATABASE_NAME}.mail_item(mailbox_id, id), > > implicitly creates an index on (mailbox_id, parent_id), right? > ------=_Part_103368_13750450.1174190913637 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Yes, that is correct. Copied following from the CREATE INDEX page in Derby's documentation
Unique, primary key, and foreign key constraints generate indexes that enforce or "back" the constraint (and are thus sometimes called backing indexes).

Mamta

On 3/17/07, Dan Karp <dkarp@zimbra.com> wrote:
Just to make sure, this foreign key declaration

  CONSTRAINT fk_mail_item_parent_id FOREIGN KEY (mailbox_id, parent_id)
    REFERENCES ${DATABASE_NAME}.mail_item(mailbox_id, id),

implicitly creates an index on (mailbox_id, parent_id), right?

------=_Part_103368_13750450.1174190913637--