[GENERAL] guids / bytea and index use ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[GENERAL] guids / bytea and index use ?

Paul Newman

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.

 

Thanks

 

Paul Newman

Reply | Threaded
Open this post in threaded view
|

Re: [GENERAL] guids / bytea and index use ?

Neil Conway-2
Paul Newman 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.

In what way was it not stored "correctly"? The size limit should not
significantly affect varchar behavior, other than bounding its maximum
size of course.

> I'd like to use bytea instead so we could use 16bytes, but are
> indexes used properly ?

Sure.

> Does anyone have any other suggestions on how to store guids ?

http://gborg.postgresql.org/project/pguuid/projdisplay.php

is out there; I haven't used it personally, though.

Is there a reason you can't use an int8?

-Neil

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [hidden email] so that your
      message can get through to the mailing list cleanly