Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

design question

 
Goto page Previous  1, 2
   Database Help (Home) -> Technology and Theory RSS
Next:  Correcting my DB with the correct PK and Relation..  
Author Message
Ed Prochak

External


Since: Jan 02, 2008
Posts: 152



(Msg. 16) Posted: Tue Nov 04, 2008 1:47 pm
Post subject: Re: design question [Login to view extended thread Info.]
Archived from groups: comp>databases>theory (more info?)

On Oct 28, 3:06 am, wrote:
> Walter Mitty wrote:
> > wrote in message
> >
> > >... I prefer to use composite foreign keys instead of
> > > surrogates, but that's another problem.
>
> > Composite foreign keys????
>
> > One uses composite foreign keys when the primary key being referenced is a
> > composite primary key.  That is all.
>
> > Are you sure you don't mean "primary keys made up by composing several
> > foreign keys"?  Just a guess on my part, since I don't really know what you
> > mean.
>
> Sorry, I was in hurry so I was not very clear. I mean some people
> prefer to use surrogate (primary) keys instead of natural composite
> keys and then use foreign keys to surrogates just for making joins
> "faster". A bad idea in my opinion...

I favor your view. There is a time and place for surrogates, but too
many jump to using ID columns as the PK right away.
Ed

 >> Stay informed about: design question 
Back to top
Login to vote
Roy Hann

External


Since: Jul 08, 2008
Posts: 50



(Msg. 17) Posted: Tue Nov 04, 2008 5:21 pm
Post subject: Re: design question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ed Prochak wrote:

> On Oct 28, 3:06 am, wrote:

>> Sorry, I was in hurry so I was not very clear. I mean some people
>> prefer to use surrogate (primary) keys instead of natural composite
>> keys and then use foreign keys to surrogates just for making joins
>> "faster". A bad idea in my opinion...
>
> I favor your view. There is a time and place for surrogates, but too
> many jump to using ID columns as the PK right away.

Worse still, it is widely considered "best practice" to do so.

At least no one will die.

--
Roy

 >> Stay informed about: design question 
Back to top
Login to vote
Walter Mitty

External


Since: Aug 01, 2008
Posts: 42



(Msg. 18) Posted: Wed Nov 05, 2008 8:25 am
Post subject: Re: design question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Ed Prochak" wrote in message

On Oct 28, 3:06 am, wrote:
> Walter Mitty wrote:
> > wrote in message

> > Are you sure you don't mean "primary keys made up by composing several
> > foreign keys"? Just a guess on my part, since I don't really know what
> > you
> > mean.
>
> Sorry, I was in hurry so I was not very clear. I mean some people
> prefer to use surrogate (primary) keys instead of natural composite
> keys and then use foreign keys to surrogates just for making joins
> "faster". A bad idea in my opinion...

>I favor your view. There is a time and place for surrogates, but too
>many jump to using ID columns as the PK right away.

I also agree. I only use ID columns for "entity tables" not "relationship
tables". And I only use them when there are no reliable natural keys
available.
 >> Stay informed about: design question 
Back to top
Login to vote
JOG

External


Since: Jan 17, 2008
Posts: 164



(Msg. 19) Posted: Thu Nov 06, 2008 8:39 am
Post subject: Re: design question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Nov 5, 1:17 pm, "Walter Mitty" wrote:
> "Ed Prochak" wrote in message
>
>
> On Oct 28, 3:06 am, wrote:
>
> > Walter Mitty wrote:
> > > wrote in message
> > > Are you sure you don't mean "primary keys made up by composing several
> > > foreign keys"? Just a guess on my part, since I don't really know what
> > > you
> > > mean.
>
> > Sorry, I was in hurry so I was not very clear. I mean some people
> > prefer to use surrogate (primary) keys instead of natural composite
> > keys and then use foreign keys to surrogates just for making joins
> > "faster". A bad idea in my opinion...
> >I favor your view. There is a time and place for surrogates, but too
> >many jump to using ID columns as the PK right away.
>
> I also agree.  I only use ID columns for "entity tables" not "relationship
> tables".  And I only use them when there are no reliable natural keys
> available.

So aptly and simply put. Why this isn't at the top, printed in bold,
of texts on the subject I have no idea.
 >> Stay informed about: design question 
Back to top
Login to vote
Walter Mitty

External


Since: Aug 01, 2008
Posts: 42



(Msg. 20) Posted: Fri Nov 07, 2008 4:25 pm
Post subject: Re: design question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"JOG" wrote in message

On Nov 5, 1:17 pm, "Walter Mitty" wrote:
> "Ed Prochak" wrote in message
>
>
> On Oct 28, 3:06 am, wrote:
>
> > Walter Mitty wrote:
> > > wrote in message
> > > Are you sure you don't mean "primary keys made up by composing several
> > > foreign keys"? Just a guess on my part, since I don't really know what
> > > you
> > > mean.
>
> > Sorry, I was in hurry so I was not very clear. I mean some people
> > prefer to use surrogate (primary) keys instead of natural composite
> > keys and then use foreign keys to surrogates just for making joins
> > "faster". A bad idea in my opinion...
> >I favor your view. There is a time and place for surrogates, but too
> >many jump to using ID columns as the PK right away.
>
> I also agree. I only use ID columns for "entity tables" not "relationship
> tables". And I only use them when there are no reliable natural keys
> available.

>So aptly and simply put. Why this isn't at the top, printed in bold,
>of texts on the subject I have no idea.

I have no idea. Back in the early eighties, when I first learned database
concepts, the best materials were presented in lectures, and backed up by
advance notes given out by the lecturer. The best presentation I saw was
organized into three stages:

The first stage was data analysis resulting in a conceptual data model. The
conceptual data model was ER modeling. I'll admit that, at first, the ER
model looked like a pale imitation of the relational model to me. It wasn't
until years later that I began to truly appreciate the simplicity and power
of the ER model. The ER model is more important for what it DOESN'T say
than for what it does say. That helps prevent design decisions from
creeping into the analysis model.

The second stage was logical database design, resulting in a logical data
model. This model was specific to relational databases, but not specific to
which particular DBMS product was intended for implementation. At that
time, I never ran into the religious warfare about the difference between
SQL modeling and relational modeling that I've since seen in this newsgroup.
While there are some very real divergencies between SQL and the RDM, most
of those differences are unimportant to the task of designing and building
something real.

The logical model can re described in terms of relations, attributes, and
constraints, although I've taken to using the terminology of tables, columns
and constraints. Index design was treated as a kind of transition between
logical modeling and physical modeling. And yes, I know all about the fact
that indexes are unnecessary to describe a complete logical model. So those
of you who are thinking of reproving me for heresy can just skip the
response this time. It's archived in oodles of c.d.t. discussions over in
Google groups anyway.

The third stage was physical database design, resulting in a physical data
model. This was DBMS specific, as well as taking into account data
volumes, platform resources, responses time requirements, interface
languages and the like. The ususal mode of presenting the physical model
was CREATE scripts. Again, there was a real absence of religion, and a real
emphasis on making simple but sound decisions early on.

This stuff was simple and sound. It respected theory, but took an immensely
practical view of design.



Since that time, I've seen presentations that one the one hand take a
religious view of "right design" versus "wrong design" in a world where
there is typically a large number of satsifactory designs, and several
dimensions on which to measure "goodness" of design. One the other hand,
I've seen lots of presentations that militate for design choices that I'm
going to dismiss as just plain wrong, at the expense of being seen as
religious myself. The idea that every table should have a first column
named ID that contains an integer is one such wrong headed idea. But if you
look at such things as the "Northwind" database that comes with MS Access,
that's exactly the pattern you're going to see (unless they've changed it
for the newest version).

I've got more to say, but I've rambled enough already.
 >> Stay informed about: design question 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
relational db design question - Hello, I have a relational database design question that I cannot seem to solve in an aesthatically pleasingly way; I was hoping someone could help me with. I am trying to create a recipe database, in which I would like to associate each recipe with a..

Newbie question on table design. - Hi, I have a table T with -- let's say -- a million+ records. The application allows logical deletion of a small fraction of these records. (Un-deletion of deleted records is allowed if you have admin privs via a Priveleges table.) I can easily think...

design question - lots of columns.... - Wanted to get this groups opinion on my issue. I started a thread @ microsoft.public.sqlserver.server ......... Can you all take a look & offer any advice? ..

Looking for some design inspiration - Hello, I apologize in advance if this is off-topic but it seems like the sort of problem database implementors must have spent a great deal of time thinking about. I'm working on a project for which I've written what is essentially a custom..

DB design issue - hi, I'm going to design a db for an Interface Requirement Specification Tool. In practise I have the following main tables: -System -Interface -Message A system can have some interfaces. An interfaces can have some messages. That's the easy thing. Now, a...
   Database Help (Home) -> Technology and Theory All times are: Pacific Time (US & Canada)
Goto page Previous  1, 2
Page 2 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]