db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Bradbury <Stan.Bradb...@gmail.com>
Subject Re: Foreign key -- implicit index?
Date Mon, 19 Mar 2007 18:24:18 GMT
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?
>>>       
>> 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=".
>
>   
The query at:
http://wiki.apache.org/db-derby/ListKeyIndexes
will list the name of the backing index so you can test whether the 
constraint name is carried over to the backing index.  Otherwise you can 
specify the name returned by the query in the clause.




Mime
View raw message