Re: question about primary key
Posted in 2007
Thanks Art and Obnoxio for verifying my thoughts ( and adding a couple ). Now I am better armed to go to dev, and tell them what to do :-)) ======================== -<<Floyd Wellershaus>>- Database Administrator Unix Administrator email: fwellers@yahoo.com Home: 703-430-0805 Cell: 703-477-6045 ======================== http://www.one.org/ ----- Original Message ---- From: fred <fred@bloomberg.com> To: informix-list@iiug.org Sent: Friday, February 23, 2007 8:00:45 AM Subject: Re: question about primary key Floyd Wellershaus wrote: > It seems to me that it's better when creating a table to first add > a unique index on the column(s) you want to have a primary key on, and > then to add the primary key with the alter table add constraint statement. > It seems so, because the primary key will use the existing unique index > instead of wasting space creating another index. > > Is this thinking right ? Or is there some other reason that one method > would be preferred above another ? I'll reiterate what the Clown said. Best to create the indexes to support constraints first, yes. You get to name them and they are easier to reorg later if needed. Also you get to place the index in the dbspace in which you want it live. These are why myschema automatically produces a CREATE INDEX statements for all hidden constraint indexes generating a dummy name from the constraint type and hidden index name. Art S. Kagel > Thanks for any advice. > > Floyd _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list