guids / bytea and index use ?

Started by rahul143over 13 years ago2 messagesgeneral
Jump to latest
#1rahul143
rk204885@gmail.com

Hi,

We are currently using a 32byte varchar for our primary keys. We tried to
reduce this down to 16 bytes but varchar didn’t seem to store this
correctly. I’d like to use bytea instead so we could use 16bytes, but are
indexes used properly ? Does anyone have any other suggestions on how to
store guids ? We don’t have any experience in recompiling the postgres
source code etc.

-----

--
View this message in context: http://postgresql.1045698.n5.nabble.com/GENERAL-guids-bytea-and-index-use-tp5734650.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: rahul143 (#1)
Re: guids / bytea and index use ?

rahul143 wrote:

We are currently using a 32byte varchar for our primary keys. We tried to
reduce this down to 16 bytes but varchar didn’t seem to store this
correctly. I’d like to use bytea instead so we could use 16bytes, but are
indexes used properly ? Does anyone have any other suggestions on how to
store guids ? We don’t have any experience in recompiling the postgres
source code etc.

http://www.postgresql.org/docs/9.2/static/datatype-uuid.html

You should use this data type.
In old versions of PostgreSQL, a bytea should do.

I am not sure what you mean with "used properly".
As long as you search for equality on the field,
the index would be eligible.

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general