Subject Re: [firebird-support] Possible to have an index across 2 tables?
Author Helen Borrie
At 08:48 PM 4/11/2008, you wrote:
>Hi Helen,
>
>Helen Borrie ha scritto:
>> Table Records
>> Customers 15000 PK ID
>> Incidents 150000 PK ID, CustomerID references Customers.ID
>> Comms 1500000 PK ID, IncidentID references Incidents.ID
>>
>>
>> So what you said before isn't quite correct. You have a 1:1 relationship between an Incident and a Customer, and a 1:1 relationship between a Comm and an Incident. That won't let your comms records get confused by customer.
>>
>Seems to me, from count of Records, that there are 1:N relationships. N
>incident and 1 customer, N Comm and 1 incident.

That is true but it is not what I was observing...

>Incidents.CustomerID and Comms.IncidentID are not UNIQUE indexes as you
>initially supposed.

Wrong, I did not suppose that. But *one incident RECORD* refers to *one customer record* - so it is not many:many as the OP originally implied. And likewise, one comm RECORD refers to one incident record.

>Anyway, comms records can't get confused by customer.

Exactly.

./heLen