Fast Re-add referential constraint
Posted in 1999
Topics: Triggers, Constraints & Referential Integrity, Versions, Editions & End-of-Life
IDS 7.24.UC5 Is there a fast way to re-add a referential integrity constraint to a large table? Currently the process takes 30 hours (several million row table). This is because the process re-verifies all the data. Can't the re-verify step be skipped? I just want the constraint for new data! ...Terry. Terry_Gauchat@providian.com -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
tgauchat@jps.net wrote:
>
> IDS 7.24.UC5
>
> Is there a fast way to re-add a referential integrity constraint to a large
> table?
>
> Currently the process takes 30 hours (several million row table).
>
> This is because the process re-verifies all the data.
>
> Can't the re-verify step be skipped? I just want the constraint for new data!
It can be done. But you should know what you are doing! It is possible,
if you
know the integrity is perfect (e.g. dbimport of an database).
This is the way:
alter table add constraint ... disabled;update informix.sysobjstate set state = 'E'
where objtype = 'C' and owner = <owner> and name = <constrname> and
tabid = <tabid>;
hth
martin