Search Postgresql Archives

DATATYPE for HEX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux