Re: Lists or external TABLE?

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: xchris <lyralyra(at)fastmail(dot)fm>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Lists or external TABLE?
Date: 2005-10-04 21:01:37
Message-ID: 20051004210137.GZ40138@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Sep 30, 2005 at 10:34:35AM +0100, Richard Huxton wrote:
> xchris wrote:
> >
> >Let's suppose i need to add an info about addresses (which includes
> >country,city,cap....etc etc).
> >Addresses can vary from 1 to 20 entries..
> >
> >Talking about performance is it better to include a list of addresses in
> >TABLE A or is it better to create an external TABLE B?
>
> Don't optimise before you have to.
>
> Do the addresses belong in "A"? If so, put them there. On the other
> hand, if you want items in "A" to have more than one address, or to
> share addresses then clearly you will want a separate address table.
> It's difficult to say more without a clear example of your requirements.
>
> Even if you choose to alter your design for performance reasons, you
> should make sure you run tests with realistic workloads and hardware.
> But first, trust PG to do its job and design your database according to
> the problem requirements.

On top of what Richard said, 5000 rows is pretty tiny. Even if each row
was 1K wide, that's still only 5MB.

Also, if from a data-model standpoint it doesn't matter which way you
go, I suggest looking at what it will take to write queries against both
versions before deciding. I tend to stay away from arrays because
they tend to be harder to query against.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jim C. Nasby 2005-10-04 21:02:23 Re: Ultra-cheap NVRAM device
Previous Message Jim C. Nasby 2005-10-04 20:57:20 Re: Is There Any Way ....