Subject | Re: [firebird-support] create unique index vs alter table add unique() |
---|---|
Author | Martijn Tonies |
Post date | 2004-10-07T18:19:25Z |
Hello Erik,
only accepts unique values, but cannot be used in a FK relation).
performance thingy.
as well, but that's a different story).
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> I recently found out something I didn't know, and am curious if it'sI'm pretty sure it's the same with other dbms's...
> really 'as-designed' behavior. It certainly runs counter to my
> experience with other dbms's.
> If it's really as designed, I suggest adding a more explicit note thatWell, because you're doing a CREATE UNIQUE INDEX (which, btw,
> the constraint is NOT created in the documentation for CREATE UNIQUE
> INDEX. I'm using firebird 1.5.1.4500 classic on linux.
only accepts unique values, but cannot be used in a FK relation).
> When creating an index using 'CREATE UNIQUE INDEX MYINDEX ON MYTABLEIMO, constraints are a business-rule thingy, while indices are a
> (FIELDS)', the index is created, but it apparently doesn't add the
> constraint to the relevant table limiting operations on the table data.
> Is this actually useful for anything?
performance thingy.
> I did find that using 'ALTER TABLE MYTABLE ADD UNIQUE(FIELDS)' did whatBecause the latter adds a constraint (and automagically creates an index
> I expected, but why aren't the two idioms synonyms?
as well, but that's a different story).
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com