Re: storage space

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Don V(dot) Soledad" <don(dot)soledad(at)uratex(dot)com(dot)ph>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: storage space
Date: 2002-05-31 02:15:59
Message-ID: 14503.1022811359@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Don V. Soledad" <don(dot)soledad(at)uratex(dot)com(dot)ph> writes:
> with the above structures, is it advisable to separate "notes" table from
> "quantities" to save storage space because an invoice to us may or may not
> have note/s?

I doubt it. I'd recommend *one* notes column (allow it to contain
newlines if you want multiline notes, rather than hardwiring a maximum
number of lines). Put it in the main table and let it be NULL (or
possibly an empty string) if there's no note. It'll cost you an extra
4 bytes per row (or no extra space at all, if you use NULL and there's
already at least one other NULL in the row). Avoiding having to join
the extra table seems well worth that.

One question is whether you intend to attach a note to each item of each
order, or only to a whole order. The quantities table is not the place
if you want the latter.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Curt Sampson 2002-05-31 03:24:22 Re: Scaling with memory & disk planning
Previous Message Don V. Soledad 2002-05-31 01:38:13 storage space