DATATYPE for HEX

Поиск
Список
Период
Сортировка
От Ilja Golshtein
Тема DATATYPE for HEX
Дата
Msg-id 42B11CE0.000008.08859@mfront7.yandex.ru
обсуждение исходный текст
Ответы Re: DATATYPE for HEX  ("Ilja Golshtein" <ilejn@yandex.ru>)
Список pgsql-general
Hello!

I am choosing the best (fastest and smallest) datatype for
storing some 16-byte length application-level binary
identifiers.

This data probably must be indexed. The only operation
I really need is comparision (equal or not) and, probably,
ORDER BY.

Most natural type BINARY(16) is absent in PostgreSQL, so
my first choice was BYTEA. After that I discovered BIT(128)
is about 15% faster then BYTEA and NAME is approximately
10% faster then BIT(128).

NUMERIC is slower then BYTEA and CHAR is much slower (I use UNICODE).

Since NAME is intended for internal usage only, I am about
to switch from BYTEA to BIT.

My question are
1. What is the best datatype for my purposes?
2. Should I expect any hidden dangers here (e.g. some special types
of queries are significantly slower, say, for BIT than for BYTEA)?
3. Are there any general guidelines how to choose most suitable datatype?

Thanks a lot.

--
Best regards
Ilja Golshtein

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

Предыдущее
От: Nico Callewaert
Дата:
Сообщение: Re: Installation on latest version of Suse Linux
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] INHERITS and planning