Re: Single Byte values

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема Re: Single Byte values
Дата
Msg-id d0cp8vg905jnro2q809japu8bclm0efo8k@4ax.com
обсуждение исходный текст
Ответ на Single Byte values  (Jason Hihn <jhihn@paytimepayroll.com>)
Ответы Re: Single Byte values  (Jason Hihn <jhihn@paytimepayroll.com>)
Список pgsql-general
On Thu, 03 Apr 2003 13:35:24 -0500, Jason Hihn
<jhihn@paytimepayroll.com> wrote:
>As someone pointed out, CHAR(1) costs 5 bytes.

Jason, you already found out, that char(1) uses

>4 bytes(stored string length) + 1 data in the case of char(1).

All char(n) types are stored on 4 byte boundaries, so char(1) costs up
to 8 bytes.

>But in returning to my question, what should I be using for char(1) to
>char(4) storage?

Instead of char(1) you can use the Postgres specific type "char"
(*with* the quotes) which only needs one byte.

For char(n) a little toy has been posted to -hackers half a year ago
(cf. discussion around
http://archives.postgresql.org/pgsql-hackers/2002-10/msg00501.php).
Feel free to play around with it.  Though I wouldn't take the trouble
if only a few thousand rows are involved...

Servus
 Manfred


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: heap_mark4update: (am)invalid tid in triggers
Следующее
От: "Ed L."
Дата:
Сообщение: dbmirror revisions