pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Victor Yegorov <viktors.jegorovs@nordlb.lv>
To: Jeandre du Toit <jeandre@itvs.co.za>
Cc: pgsql-performance@postgresql.org
Subject: Re: Table Relationships
Date: Fri, 30 May 2003 13:10:09 +0300
Message-ID: <20030530101009.GD23596@nordlb.lv> (raw)
In-Reply-To: <Pine.LNX.4.44.0305301118040.6124-100000@localhost.localdomain>
References: <001c01c32689$82da1050$0403a8c0@fejleszt4>
	<Pine.LNX.4.44.0305301118040.6124-100000@localhost.localdomain>

* Jeandre du Toit <jeandre@itvs.co.za> [30.05.2003 12:57]:
> 
> What are the advantages to having a database relational? I am currently 
> discussing the design of a database with some people at work and they 
> reckon it is best to create one table with and index and all the data 
> instead of normalizing the database. I think that they think that joining 
> tables will slow down retrieval, is this true?
> 

Take a look at situation from another side.

Let's say: You own a store and have 3 customers and 5 products on your
store. All you going to keep in DB is track of all purchases.

So, each time a customer will by a product, an new record will be added.
What this means:

1. Customer's name will be repeated as many times, as many purchases he had
   made. The same for each of products. In real world, you'll have about
   10,000 customers and about 100,000 products. Do you have enoght space on
   your disks to store all that stuff?

2. Some of your customers decided to change it's name. What you're going to
   do? If you're going to insert new purchases of that customer with he's new
   name, then in all turnover reports you'll have to specify both:
   old name and new one. If he will hange his name again - again, all
   reports are to be updated.

There is much more stuff to read about Relational Data Model in books.

About slowing down retrieval of data: all efforts today are put to speed up
things. You should think about your convenience in data manipulation.


I suggest you should try both: one huge table, and a set of normalized
tables and compare, what is quicker and what is easier to use.

-- 

Victor Yegorov



view thread (12+ messages)  latest in thread

Message-ID: <20030530101009.GD23596@nordlb.lv>
Permalink:  ../20030530101009.GD23596@nordlb.lv/
Also on:    postgresql.org/message-id/20030530101009.GD23596@nordlb.lv

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: viktors.jegorovs@nordlb.lv, jeandre@itvs.co.za
  Subject: Re: Table Relationships
  In-Reply-To: <20030530101009.GD23596@nordlb.lv>
  References: <001c01c32689$82da1050$0403a8c0@fejleszt4> <Pine.LNX.4.44.0305301118040.6124-100000@localhost.localdomain> <20030530101009.GD23596@nordlb.lv>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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