Re: guids / bytea and index use ?

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "rahul143 *EXTERN*" <rk204885(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: guids / bytea and index use ?
Date: 2012-12-03 10:11:37
Message-ID: D960CB61B694CF459DCFB4B0128514C208C99F5D@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2012-12-03 13:38:50 Re: MODERATOR WARNING Re: [GENERAL] Exception Handling in C-Language Functions?
Previous Message Albe Laurenz 2012-12-03 10:05:07 Re: Postgres PHP error