Re: storage space

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: storage space
Дата
Msg-id 14503.1022811359@sss.pgh.pa.us
обсуждение исходный текст
Ответ на storage space  ("Don V. Soledad" <don.soledad@uratex.com.ph>)
Список pgsql-general
"Don V. Soledad" <don.soledad@uratex.com.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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Don V. Soledad"
Дата:
Сообщение: storage space
Следующее
От: Curt Sampson
Дата:
Сообщение: Re: Scaling with memory & disk planning