Re: Table Relationships

From: "Victor Yegorov" <viktors(dot)jegorovs(at)nordlb(dot)lv>
To: Jeandre du Toit <jeandre(at)itvs(dot)co(dot)za>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Table Relationships
Date: 2003-05-30 10:10:09
Message-ID: 20030530101009.GD23596@nordlb.lv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

* Jeandre du Toit <jeandre(at)itvs(dot)co(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Bruno Wolff III 2003-05-30 12:11:01 Re: Table Relationships
Previous Message Jeandre du Toit 2003-05-30 09:23:10 Table Relationships