Subject RE: [firebird-support] Foreign Keys
Author Ann W. Harrison
At 11:32 AM 12/20/2004, Chad Z. Hower wrote:

>:: - the target for a FK must be a constraint (an index won't do).
>:: - when you define an unique constraint, an unique index is
>:: implicitly created.
>
>If I create a constraint, will the index it creates be used for searches and
>sorting?

Yes.

> So again.. Now I am REALLY confused.. Whas the difference between a
>unique constraint and a unique index?

A unique constraint is something defined in the standard that
insures that there are no duplicates in a field or set of fields.
A unique index is an underlying physical structure that the
standard knows nothing about.

In the Firebird implementation, and all others I know of, the
unique constraint is implemented by creating a unique index.

>I know Helen replied - and it made a
>little sense but now Im more confused than before.
>
>:: - when you define an unique index, you have practically the
>:: same effect as defining an unique constraint, minus the
>:: ability to have FKs point to it.
>
>Why though?

Because that's what the standard requires.



Regards,


Ann