Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 48850 invoked from network); 18 Mar 2007 21:57:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Mar 2007 21:57:10 -0000 Received: (qmail 46502 invoked by uid 500); 18 Mar 2007 21:57:17 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 46476 invoked by uid 500); 18 Mar 2007 21:57:16 -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 46465 invoked by uid 99); 18 Mar 2007 21:57:16 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Mar 2007 14:57:16 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [4.78.240.39] (HELO mta02.zimbra.com) (4.78.240.39) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Mar 2007 14:57:08 -0700 Received: from dogfood.zimbra.com (dogfood.liquidsys.com [66.92.25.198]) by mta02.zimbra.com (Postfix) with ESMTP id 680AB8104F8 for ; Sun, 18 Mar 2007 13:50:37 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by dogfood.zimbra.com (Postfix) with ESMTP id 54814775B5 for ; Sun, 18 Mar 2007 14:56:47 -0700 (PDT) X-Virus-Scanned: amavisd-new at dogfood.zimbra.com Received: from dogfood.zimbra.com ([127.0.0.1]) by localhost (dogfood.zimbra.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aEpE9CjwsVQQ for ; Sun, 18 Mar 2007 14:56:46 -0700 (PDT) Received: from dogfood.zimbra.com (localhost.localdomain [127.0.0.1]) by dogfood.zimbra.com (Postfix) with ESMTP id A5A2C775B4 for ; Sun, 18 Mar 2007 14:56:46 -0700 (PDT) Date: Sun, 18 Mar 2007 14:56:46 -0700 (PDT) From: Dan Karp To: Derby Discussion Message-ID: <1384897708.43121174255006520.JavaMail.root@dogfood.liquidsys.com> In-Reply-To: Subject: Re: Foreign key -- implicit index? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [75.23.60.148] X-Virus-Checked: Checked by ClamAV on apache.org > > 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? > > 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 ). Is there any way to explicitly assign a name to this backing index? In my case, I want to force the optimizer to choose the backing index using "-- DERBY-PROPERTIES index=".