Guids as primary keys

Steven Feuerstein wrote a blog post on using Guids in Oracle. One of the things Guids could be used to create a primary key value for a record in the table. How does using this kind of primary keys relate to the speed of your queries. I could imagine that using guids can be slower in your select statements because Oracle has to compare more data to make the connection between the primary key of one table and the foreign key of the other. Especially when you save the Guid in human readable form as a varchar2 value. I may need to do some tests, although I don’t really need a universally unique primary key in the databases I currently work with. Guids may come in handy when you have distributed databases which need to be merged into one at some time(s). Interesting techniques, but not really needed right now (for my situation that is).

Leave a Reply

Your email address will not be published. Required fields are marked *