Re: UUID as a primary key
BIGINT UNSIGNED would be faster.
If you stick with CHAR(36), change it to one of these:
BINARY(36)
CHAR(36) BINARY
Either of those would avoid the collation issues implied by most of Aftab's points.
With InnoDB, the length of the PRIMARY KEY is not that big a deal, until you count the secondary key(s) -- they have a copy of the PK.
About the only reason to have a uuid instead of an AUTO_INCREMENT is if you don't have a centralized service to dish out IDs.
Thanks for the tip on converting a uuid into a BIGINT.
Subject
Views
Written By
Posted
41546
May 20, 2009 06:51AM
20247
May 20, 2009 07:55AM
15241
May 20, 2009 08:29AM
Re: UUID as a primary key
15351
May 20, 2009 08:44AM
12533
May 20, 2009 09:04AM
14035
May 20, 2009 09:50AM
10534
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.