Subject | Re: [firebird-support] Unique constraint vs unique index, why do they have to be different? |
---|---|
Author | Ivan Prenosil |
Post date | 2003-12-15T13:19:21Z |
- Unique Constraint is defined by SQL standard as mean to achieve data integrity.
- Index is something to speed up processing, hence SQL standard does not care
about it at all (although all dbms use it).
Unique Constraint just happens to be implemented using index with unique flag,
and that flag is accessible in Create Index command too.
So although you can enforce uniqueness by createting unique index,
I would personally not mix the role of both, i.e. use constraints for integrity,
and use indexes for speed tuning. (Metadata will be much nicer/cleaner then.)
Ivan
- Index is something to speed up processing, hence SQL standard does not care
about it at all (although all dbms use it).
Unique Constraint just happens to be implemented using index with unique flag,
and that flag is accessible in Create Index command too.
So although you can enforce uniqueness by createting unique index,
I would personally not mix the role of both, i.e. use constraints for integrity,
and use indexes for speed tuning. (Metadata will be much nicer/cleaner then.)
Ivan