X-Original-To: pgsql-performance@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id EAEF9923407 for ; Fri, 30 May 2003 06:08:46 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 59102-07 for ; Fri, 30 May 2003 06:07:50 -0400 (EDT) Received: from shield.nordlb.lv (shield.pirmabanka.lv [195.114.57.4]) by developer.postgresql.org (Postfix) with ESMTP id 0CFED9233FE for ; Fri, 30 May 2003 06:07:39 -0400 (EDT) Received: from wall2.pirmabanka.lv (wall2-pub.nordlb.lv [195.114.57.14]) by shield.nordlb.lv (8.12.9/8.12.9) with SMTP id h4UA7MGZ009440 for ; Fri, 30 May 2003 13:07:22 +0300 Received: from share.nordlb.lv ([10.0.0.10]) by wall2.pirmabanka.lv; Fri, 30 May 2003 13:07:21 +0300 (EET DST) Received: from pc311x1.nordlb.lv (localhost.localdomain [127.0.0.1]) by nordlb.lv (8.11.6/8.11.6) with SMTP id h4UA7HL14568 for ; Fri, 30 May 2003 13:07:21 +0300 Received: (qmail 6220 invoked by uid 100); 30 May 2003 10:10:09 -0000 Date: Fri, 30 May 2003 13:10:09 +0300 From: "Victor Yegorov" To: Jeandre du Toit Cc: pgsql-performance@postgresql.org Subject: Re: Table Relationships Message-ID: <20030530101009.GD23596@nordlb.lv> References: <001c01c32689$82da1050$0403a8c0@fejleszt4> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/271 X-Sequence-Number: 2050 * Jeandre du Toit [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