public inbox for [email protected]  
help / color / mirror / Atom feed
Database Design Question
4+ messages / 4 participants
[nested] [flat]

* Database Design Question
@ 2001-07-27 18:03 Gonzo Rock <[email protected]>
  2001-07-27 19:06 ` Re: Database Design Question Andre Schnabel <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Gonzo Rock @ 2001-07-27 18:03 UTC (permalink / raw)
  To: pgsql-general

A Question for those of you who consider yourself crack Database Designers.

I am currently moving a large database(100+Tables) into pgSQL... with the intention of deploying against 'any' SQL database in the future. The development side will be rigorously using Standard SQL constructs with no unique/proprietary extensions.

My question concerns establishing the relationships.

Currently Relationships between tables are established via a Unique Integer ID like this:

*=APrimaryKey

 PartTypes    Customer     Parts
 ---------    --------     -----
 PartTypeID   CustomerID   PartID
*PartType    *Customer     PartTypeID
              Address      CustomerID
                          *PartNumber(2FieldPrimaryKey)
                          *PartRevision(2FieldPrimaryKey)
                           PartName
                      

HOWEVER; I have read lots of texts describing the Relational Design should be instead like this:

*=APrimaryKey

 PartTypes    Customer     Parts
 ---------    --------     -----
*PartType    *Customer     PartType  
              Address     *PartNumber(2FieldPrimaryKey)
                          *PartRevison(2FieldPrimaryKey)
                           PartName    
                           Customer
                                          
Both Techniques have a unique foreign key back to the parent tables but one uses No.Meaningful.Info.Integer.Data for the ForeignKey while the second uses Human.Understandable.ForeignKeys

Is one recommended over the other??? Sure appreciate the commentary before I get in too deep with all these tables.

Thanks!





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Database Design Question
  2001-07-27 18:03 Database Design Question Gonzo Rock <[email protected]>
@ 2001-07-27 19:06 ` Andre Schnabel <[email protected]>
  2001-07-27 20:21   ` PostgreSQL to Dia program Brent R. Matzelle <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Andre Schnabel @ 2001-07-27 19:06 UTC (permalink / raw)
  To: Gonzo Rock <[email protected]>; pgsql-general

Don't really know, if I am a crack .. but ...

Your 1st Design would be faster when joining the tables in a query or view. Furthermore an index on the id's (should be integers, right?) would use much less storage space than an index on character-fields.

The 2nd design is preferred by theoretical purists. The data are much more selfexplaining. If you only have a Parts-record you can see to which Parttype an Costumer it belongs without qeurying the other tables. With your 1st design you had to.

I think it's a question of performance, storagespace and readability.
If you need high performace use the 1st Design.
If you need a design, readable by people who don't work day by day with it, use the 2nd method.

It's only my opinion, must not be right.

CU,
Andre
  ----- Original Message ----- 
  From: Gonzo Rock 
  To: [email protected] 
  Sent: Friday, July 27, 2001 8:03 PM
  Subject: [GENERAL] Database Design Question


  A Question for those of you who consider yourself crack Database Designers.

  I am currently moving a large database(100+Tables) into pgSQL... with the intention of deploying against 'any' SQL database in the future. The development side will be rigorously using Standard SQL constructs with no unique/proprietary extensions.

  My question concerns establishing the relationships.

  Currently Relationships between tables are established via a Unique Integer ID like this:

  *=APrimaryKey

   PartTypes    Customer     Parts
   ---------    --------     -----
   PartTypeID   CustomerID   PartID
  *PartType    *Customer     PartTypeID
                Address      CustomerID
                            *PartNumber(2FieldPrimaryKey)
                            *PartRevision(2FieldPrimaryKey)
                             PartName
                        

  HOWEVER; I have read lots of texts describing the Relational Design should be instead like this:

  *=APrimaryKey

   PartTypes    Customer     Parts
   ---------    --------     -----
  *PartType    *Customer     PartType  
                Address     *PartNumber(2FieldPrimaryKey)
                            *PartRevison(2FieldPrimaryKey)
                             PartName    
                             Customer
                                            
  Both Techniques have a unique foreign key back to the parent tables but one uses No.Meaningful.Info.Integer.Data for the ForeignKey while the second uses Human.Understandable.ForeignKeys

  Is one recommended over the other??? Sure appreciate the commentary before I get in too deep with all these tables.

  Thanks!



  ---------------------------(end of broadcast)---------------------------
  TIP 5: Have you checked our extensive FAQ?

  http://www.postgresql.org/users-lounge/docs/faq.html


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* PostgreSQL to Dia program
  2001-07-27 18:03 Database Design Question Gonzo Rock <[email protected]>
  2001-07-27 19:06 ` Re: Database Design Question Andre Schnabel <[email protected]>
@ 2001-07-27 20:21   ` Brent R. Matzelle <[email protected]>
  2001-07-28 03:14     ` Re: PostgreSQL to Dia program Justin Clift <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Brent R. Matzelle @ 2001-07-27 20:21 UTC (permalink / raw)
  To: pgsql-general

Someone just posted a PostgreSQL to Dia automatic diagram
creation tool.  I have not tested it, but if it works it could
be a huge help.  

http://www.zort.ca/postgresql/

Justin, this could definately be a techdocs link.

Brent

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: PostgreSQL to Dia program
  2001-07-27 18:03 Database Design Question Gonzo Rock <[email protected]>
  2001-07-27 19:06 ` Re: Database Design Question Andre Schnabel <[email protected]>
  2001-07-27 20:21   ` PostgreSQL to Dia program Brent R. Matzelle <[email protected]>
@ 2001-07-28 03:14     ` Justin Clift <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Justin Clift @ 2001-07-28 03:14 UTC (permalink / raw)
  To: Brent R. Matzelle <[email protected]>; pgsql-general

Hi Brent,

Thanks for this!  I'll put it on my ToDo list for adding.

Good thing I came across your email, about 2/3 to 3/4 of all the
pgsql-general emails I never even get time to read.  :(

If you REALLY want to make sure I read something, please CC it to me of
course!

:-)

Regards and best wishes,

Justin Clift


"Brent R. Matzelle" wrote:
> 
> Someone just posted a PostgreSQL to Dia automatic diagram
> creation tool.  I have not tested it, but if it works it could
> be a huge help.
> 
> http://www.zort.ca/postgresql/
> 
> Justin, this could definately be a techdocs link.
> 
> Brent
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to [email protected] so that your
> message can get through to the mailing list cleanly

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
   - Indira Gandhi




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2001-07-28 03:14 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-07-27 18:03 Database Design Question Gonzo Rock <[email protected]>
2001-07-27 19:06 ` Andre Schnabel <[email protected]>
2001-07-27 20:21   ` PostgreSQL to Dia program Brent R. Matzelle <[email protected]>
2001-07-28 03:14     ` Re: PostgreSQL to Dia program Justin Clift <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox