db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Price <epr...@ptc.com>
Subject Re: foreign-key: how to reference two fields?
Date Tue, 15 Apr 2003 14:12:27 GMT

Michael Schmitt wrote:
> Hi,
> I am wondering how to manage something like the following:
> I have got a table with some foreign key, but the key consists of two
> values.


>     <foreign-key foreignTable="city">
>       <reference local="origin_city" foreign="name"/>
>       <reference local="origin_country" foreign="country_name"/>
>     </foreign-key
>   </table>
> To get a unique city, you need the city's name and its country.

I know you have already solved your problem.  But I am curious, for my 
own understanding (being very new to Torque) -- would you get better 
performance by generating a table of unique city name/country pairs and 
using an indexed primary key as the foreign key?  Or does that not work 
with Torque, or... (?)


View raw message