Re: extensible enum types

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: extensible enum types
Дата
Msg-id 4C1BB3ED.9090000@dunslane.net
обсуждение исходный текст
Ответ на Re: extensible enum types  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: extensible enum types  (Robert Haas <robertmhaas@gmail.com>)
Re: extensible enum types  (Joseph Adams <joeyadams3.14159@gmail.com>)
Список pgsql-hackers

Robert Haas wrote:
> On Fri, Jun 18, 2010 at 12:59 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
>   
>> You are just bumping up the storage cost. Part of the attraction of enums is
>> their efficiency.
>>     
>
> What's efficient about them?  Aren't we using 4 bytes to store a value
> that will nearly always fit in 2, if not 1?
>
>   
This was debated when we implemented enums. As between 1,2 and 4 there 
is often not much to choose, as alignment padding makes it pretty much 
the same. But any of them are more efficient than storing a numeric 
value or the label itself.

Anyway, it might well be moot.

cheers

andrew




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

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: hstore ==> and deprecate =>
Следующее
От: Robert Haas
Дата:
Сообщение: Re: extensible enum types