MySQL Forums
Forum List  »  Performance

Re: UUID as a primary key
Posted by: B J
Date: May 20, 2009 09:04AM

In fact I just realized you shouldn't convert UUIDs to BIGINT, because the maximal value of a UUID (0XFFFFFF...) exceeds the maximal value of a bigint, so you may alter it!

Instead, it would be possible to store it in a binary(16): if you remove the 4 dashes, you get 16 bytes represented by two characters in the string ((36-4)/2=16).

Do you think this would avoid using a secondary key?

Options: ReplyQuote


Subject
Views
Written By
Posted
41523
B J
May 20, 2009 06:51AM
20242
May 20, 2009 07:55AM
15236
B J
May 20, 2009 08:29AM
15345
May 20, 2009 08:44AM
Re: UUID as a primary key
12528
B J
May 20, 2009 09:04AM
14033
May 20, 2009 09:50AM
10532
B J
May 20, 2009 10:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.