Re: How to handle primary and foreign key indexes in Informix?
Posted in 1997
nslard <nslard@po.pacific.net.sg> wrote: :On the topic of indices ( Primary and FOreign keys ) which data field :should we select as the primary key. Does selecting a different field :slow down the programme execution? : :Mave The shorter the primary key the better. A long primary key will result in a larger index and may slow down the application. It's allmost allways a database design error if your primary key is some long character column or a large number of columns as a composit key. Sometimes it's best to add a serial column and use that as the primary key instead of a large composit. This also enable you to use a single integer as the foreign key in other tables. It's all design issues where experience is the best helper. Before you gain experience you read relational theory (all the books and articles you can find) and test. Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org