Re: column size and storage efficiency

Поиск
Список
Период
Сортировка
От Sean Davis
Тема Re: column size and storage efficiency
Дата
Msg-id 264855a00811251808o29b09243ma9ff4f20358e9839@mail.gmail.com
обсуждение исходный текст
Ответ на column size and storage efficiency  (Bruce Hyatt <brucejhyatt@yahoo.com>)
Ответы Re: column size and storage efficiency  (Bruce Hyatt <brucejhyatt@yahoo.com>)
Список pgsql-novice


On Tue, Nov 25, 2008 at 8:51 PM, Bruce Hyatt <brucejhyatt@yahoo.com> wrote:
My inclination when creating tables is to create columns using varchar-sizes in increments of 10 or 5 but I suspect there must be more-efficient sizes, specifically, values like 16, 32, 64 minus header-bits.

- Is this true? Does it really have much impact on storage?
- How many bits are the headers?
- How does TOAST factor in?

Believe it or not, specifying the varchar size has no impact on storage size.  So, a varchar and a varchar(2) if both have two characters take the same storage space. 

Toast is described pretty well in the documentation (better than I can describe it).


Sean

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

Предыдущее
От: Bruce Hyatt
Дата:
Сообщение: column size and storage efficiency
Следующее
От: Bruce Hyatt
Дата:
Сообщение: Re: column size and storage efficiency