Re: Are there performance advantages in storing bulky field in separate table?
Robert Treat <xzilla@users.sourceforge.net>
From: Robert Treat <xzilla@users.sourceforge.net>
To: pgsql-general@postgresql.org
Cc: Ian Mayo <ianmayo@tesco.net>
Date: 2009-04-08T21:06:44Z
Lists: pgsql-general
On Wednesday 08 April 2009 15:30:28 Ian Mayo wrote: > On Wed, Apr 8, 2009 at 8:13 PM, Robert Treat > > <xzilla@users.sourceforge.net> wrote: > > Maybe I've been reading too much Pascal again lately, but if only 1% of > > your rows are going to have data in this column, personally, I'd put it > > in a separate table. > > thanks for that Robert - it does match my (completely groundless) > first impression. > > In the nature of debate, would you mind passing on the pascal-related > reasons why you'd put the data in another table? > You can be sure that discussion of this topic in this forum will soon be visited by religious zealots, but the short answer is "nulls are bad, mmkay". A slightly longer answer would be that, as a general rule, attributes of your relations that only apply to 1% of the rows are better represented as a one to N relationship using a second table. For a longer answer, see http://www.databasedesign-resource.com/null-values-in-a-database.html or http://www.dbazine.com/ofinterest/oi-articles/pascal27 -- Robert Treat Conjecture: http://www.xzilla.net Consulting: http://www.omniti.com