Subject | Re: [firebird-support] DDL for graph edges |
---|---|
Author | Michael Ludwig |
Post date | 2010-05-03T19:21:46Z |
Doug Chamberlin schrieb am 03.05.2010 um 09:19:19 (-0400):
[Re: [firebird-support] DDL for graph edges]
index for B :-)
--
Michael Ludwig
[Re: [firebird-support] DDL for graph edges]
> On 5/3/2010 3:34 AM, Michael Ludwig wrote:That's a big part of why I like this primary key!
> >
> > What about the PRIMARY KEY( a, b ) ? It looks okay to me, but I'm
> > reading in Helen's book (on p.274) advice against compound primary
> > keys in Firebird.
> I think her caution relates to long compound keys (that people
> sometimes create for other RDBMS). Creating a single PRIMARY KEY (A,B)
> is fine. Firebird will use it when it knows the A value so there is no
> need for a separate index on A. Having that primary key also gets you
> a unique constraint on A+B as an important by product.
> You can then add just the index on B which would be useful forIn fact, with foreign key constraints on both A and B, I already have an
> searching/joining when only the B value was known.
index for B :-)
> Surrogate keys are best as replacements for those long compound keysThanks for kindly sharing your advice.
> mentioned earlier. You do not have those so I would advise keeping it
> simpler without a surrogate key.
--
Michael Ludwig