Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 863A32E0059 for ; Wed, 30 Apr 2008 11:25:47 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58224-05 for ; Wed, 30 Apr 2008 11:25:36 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from vms044pub.verizon.net (vms044pub.verizon.net [206.46.252.44]) by developer.postgresql.org (Postfix) with ESMTP id A99772E0048 for ; Wed, 30 Apr 2008 11:25:42 -0300 (ADT) Received: from [192.168.0.251] ([96.242.5.78]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K0500HL76PZYR81@vms044.mailsrvcs.net> for pgsql-sql@postgresql.org; Wed, 30 Apr 2008 09:25:13 -0500 (CDT) Date: Wed, 30 Apr 2008 10:25:11 -0400 From: Jean-David Beyer Subject: Re: Curious about wide tables. In-reply-to: <48149C95.9080706@Sheeky.Biz> To: pgsql-sql@postgresql.org Message-id: <48188147.2060201@verizon.net> Organization: Institute for Regimented Whimsey MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Enigmail-Version: 0.94.0.0 References: <48147917.8000108@verizon.net> <48149C95.9080706@Sheeky.Biz> User-Agent: Thunderbird 1.5.0.9 (X11/20070317) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/225 X-Sequence-Number: 30764 Shane Ambler wrote: > Jean-David Beyer wrote: >> In another thread, the O.P. had a question about a large table with >> over 100 columns. Is this usual? Whenever I make a database, which is >> not often, it ends up with tables that rarely have over to columns, and >> usually less than that. When normalized, my tables rarely get very >> wide. >> >> Without criticising the O.P., since I know nothing about his >> application, I am curious how it comes about that such a wide table is >> justified. >> > > Depends on the application. > > Something like drivers license db will have a few things like name, > address, type, dob, restrictions and end date > > Then something like an insurance policy where each record needs to know > who it is for, the item(car - rego make model... house - address suburb > state), effective date, end date, date of inception, type of cover, value > of cover, excess amount, base premium, agent fees, gov fees, total > premium, invoice sent, who entered it and when...... > > Sometimes you can have a lot of data that makes up one instance. > I guess it depends on the application and its use. I guess I _could_ normalize that insurance policy database to where there would be lots of tables with few fields. E.g., Policy Number, Owner Policy Number, make Policy Number, house address Policy Number, State ... And that would make sense _if_ there were lots of queries such as "How many Oldsmobiles are there?" or even "How many Fords are in Indiana?" But that would be carrying normalization too far if the typical query is something like "Print out everything about policy number xxx., or "Raise all rates in Indiana for Chryslers that expire in August by yy%" So I guess it would depend on what the typical "query" is. On the one hand, I like to normalize things a lot. But on the other hand, data to be retrieved together should be stored together. -- .~. Jean-David Beyer Registered Linux User 85642. /V\ PGP-Key: 9A2FC99A Registered Machine 241939. /( )\ Shrewsbury, New Jersey http://counter.li.org ^^-^^ 10:15:01 up 43 days, 15:17, 2 users, load average: 4.20, 4.20, 4.21