Re: Are there performance advantages in storing bulky field in separate table?

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Ian Mayo <ianmayo(at)tesco(dot)net>
Subject: Re: Are there performance advantages in storing bulky field in separate table?
Date: 2009-04-08 21:06:44
Message-ID: 200904081706.45004.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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(at)users(dot)sourceforge(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2009-04-08 21:59:43 Re: recovery after segmentation fault
Previous Message Tom Lane 2009-04-08 20:42:06 Re: some external sql not working in psql