X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9967AD1B8B7 for ; Tue, 4 May 2004 12:44:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 12784-09 for ; Tue, 4 May 2004 12:43:39 -0300 (ADT) Received: from outmx016.isp.belgacom.be (outmx016.isp.belgacom.be [195.238.2.115]) by svr1.postgresql.org (Postfix) with ESMTP id 90964D1DC69 for ; Tue, 4 May 2004 12:43:38 -0300 (ADT) Received: from ALAIN (164-253.242.81.adsl.skynet.be [81.242.253.164]) by outmx016.isp.belgacom.be (8.12.9/8.12.9/Skynet-OUT-2.21) with ESMTP id i44FhWNq015320; Tue, 4 May 2004 17:43:32 +0200 (envelope-from ) From: "Alain Reymond" To: "Andrei Bintintan" Date: Tue, 04 May 2004 17:45:44 +0200 MIME-Version: 1.0 Subject: Re: Database structure Cc: pgsql-sql@postgresql.org Message-ID: <4097D6C8.31518.1705566@localhost> In-reply-to: <00a401c431e5$51dc7250$0b00a8c0@forge> X-mailer: Pegasus Mail for Windows (4.21) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-RAVMilter-Version: 8.4.3(snapshot 20030212) (outmx016.isp.belgacom.be) X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=2.0 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS, WEIRD_PORT X-Spam-Level: ** X-Archive-Number: 200405/39 X-Sequence-Number: 17753 I thank you for your answer. The more I think about it, the more I find the second option better. Just one precision. All tests are always done, so I always hae all columns filled with a result. My only trouble was about size and performance. I store only a few byte with a lot of overhead (#assessment_nr, labtest_nr) for only one integer and one real per row. And I can have up to 1.500.000 rows per year with at least 10 years on line... It means big indexes. Regards. Alain > I would go for the second one. I think the size of the table is not a > problem. You will have just to write the right indexes for easy joins. > > OBS: " For one assessment, I'll store 60 rows with only two useful > integers in it" ... why? Better make a "lab_test" table where you have > the tab tests and you write in the results(#assessment_nr, labtest_nr, > p, d) only those datas that you have. For example if you have the > assesment no. 3000 and you have only the results for lab_test 10->40 > then why to write in the DB also the lab_test from 40->70(if you don't > have it)??? (if I didn't understand this clear, sorry for the > observation). > > > The second option is better if you change one time the lab_test > list(have to think also this option --- if making the database for at > least 10 years). Because in the first solution you will have to add > always a new column... and that is not the "best" option. In the > second way you just add a new ID in the lab_test list and finish. No > problems. > > If you go for the first option and you have to change something in the > result table... it won't be easy. > > The alter table is not so tragical as it seems... use > constrains...don't ever erase from DB. > > So... my final answer: the second option. Alain Reymond CEIA Bd Saint-Michel 119 1040 Bruxelles Tel: +32 2 736 04 58 Fax: +32 2 736 58 02 alain.reymond@ceia.com PGP key sur http://pgpkeys.mit.edu:11371