Foreign Key ?
Posted in 1997
You said you had created the index in advance. Did you create indexes on BOTH the parent table ( unique ) and the child table? If not, Informix will create the index(es) for you with their own naming convention. Mike Ballentine --------------------------( Forwarded letter 1 follows )--------------------- Date: Thursday, 3 April 1997 5:42pm X-Sender: jvemo@mail.cyberspace.com X-Mailer: Windows Eudora Pro Version 3.0 (32) Date:Thu, 3 Apr 1997 17:10:11 -0600 To: informix-list@rmy.emory.edu From: jvemo@cyberspace.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: informix-list-owner@rmy.emory.edu Reply-To: jvemo@cyberspace.com (Jon C Vemo) X-Informix-List-Id: <list.13851> Here's a situation: Two tables (90 million rows each). To enforce integrity, I want to build a FK (foreign key) constraint on TabB, pointing back to TabA. However, even with TabA and TabB fragmented 10 and 6 ways, respectively, it takes over 26 hours to execute an alter table to add the FK (with the index already created). So....how are people doing it?? I presume you would use a trigger on TabB, and take the performance hit of firing the trigger. Can anyone suggest a better method?? FWIW, ODS 7.22 running on Sequent. Jon ---------------------------------------------------------------------------- --- Jon C. Vemo "Life is like a dogsled team, if you ain't the jvemo@cyberspace.com lead dog the scenery never changes." ---------------------------------------------------------------------------- ---