[GENERAL] ENUM type size

Поиск
Список
Период
Сортировка
От Олег Самойлов
Тема [GENERAL] ENUM type size
Дата
Msg-id 1504383787.16950.8.camel@mipt.ru
обсуждение исходный текст
Ответы Re: [GENERAL] ENUM type size  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
May I ask the question here or I must go to the pgsql-hackers?

Why does ENUM type have 4 byte size? In any use cases, that I know,
ENUM 255 values (1 byte) more then enough. And it's only reason for
ENUM, if you need more values then 255 you can create a foreign table
with smallint (or bigger) primary key. And, obviously that table will
be filled by operators or routines, not by a programmer. The only
reason for ENUM is to use for fields with very small set of values, for
instance: sex, day of week, month, etc. And 1 byte size is 4 times
shorter then 4 bytes, especially for big tables.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Numeric numbers
Следующее
От: Олег Самойлов
Дата:
Сообщение: Re: [GENERAL] Numeric numbers