Re: primary key in a hierarchy

From: Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl>
Date: 29 Nov 2000 12:55:09 GMT
Message-ID: <902ubd$s4j$1_at_news.tue.nl>


Christophe Geraud wrote:
> In the case I work on, the "number" has a meaning :
> it is the identifier of the B elt for its A elt.

I see. In that case you probably want to tell the database anyway that {ID_A, Number} is a candidate key (even if you take {ID_B} as the primary key). Which usually means that it is going to define an index for this combination anyway. But you should check this for the database system you intend to use. You even may decide to ignore this candidate key constraint for efficiency reasons.  

> The first way seems to be better for indexes creation. Is'nt it ?

Yes it is. Especially for smaller databases such as Access. So again, I would experiment a litte with your database to see how large the indices become and how much they slow things down.

-- 
  Jan Hidders
Received on Wed Nov 29 2000 - 13:55:09 CET

Original text of this message