Referential constraints
Posted in 1999
Topics: Storage & Space Management, Migration, Import/Export & Data Conversion
I would like to start putting referential constraints on our databases to prevent some problems with invalid deletes and inserts. However, I dimly remember being told that with Informix referential constraints make bulk unloading and loading data a real chore. We average one complete unload and reload of our databases each year to re-organize disk space. Any thoughts on this? ==================================================================== Harold Luse Phone: (970) 491-4120 Veterinary Teaching Hospital Fax: (970) 491-4123 Colorado State University Pager: (970) 229-8173 Fort Collins, Colorado USA E-mail: hluse@vth.colostate.edu ====================================================================
From what you said "once a year" mass loading, there should be no problem. It should not affect unloading at all. If referential constraints are in place then unloading data, dropping constraints, loading data, apply constraints would be the once a year formula. To get a graph of referential constraints ordering I have a script at url: http://www.tc.umn.edu/~hause011 the script is ref_load_ord for referential constraint load order. This will help you figure out the order to apply constraints after dropping them or loading data into tables (mass or otherwise) when constraints are applied. -- --------------------------------------------------------- Steven Hauser email: hause011@tc.umn.edu URL: http://www.tc.umn.edu/~hause011 ---------------------------------------------------------
I would submit that you don't want to drop the constraints -- better to disable them. That way you don't have to worry about missing one when you re-create them. You just do: SET CONSTRAINTS FOR table ENABLED and you're all set. Steven Hauser wrote in message <7drbgr$49d$1@garnet.tc.umn.edu>... >From what you said "once a year" mass loading, there should be no >problem. It should not affect unloading at all. > >If referential constraints are in place then unloading data, >dropping constraints, loading data, apply constraints would be >the once a year formula. > >To get a graph of referential constraints ordering I have a >script at url: > >http://www.tc.umn.edu/~hause011 > >the script is ref_load_ord for referential constraint load order. > >This will help you figure out the order to apply constraints after >dropping them or loading data into tables (mass or otherwise) >when constraints are applied. > > >-- >--------------------------------------------------------- >Steven Hauser >email: hause011@tc.umn.edu URL: http://www.tc.umn.edu/~hause011 >---------------------------------------------------------