MySQL Forums
Forum List  »  Performance

UUID as a primary key
Posted by: B J
Date: May 20, 2009 06:51AM

Hi everybody

I'm working on a project which needs a multi-master db architecture, there will be a central database and many 'client' databases used by applications which can run in offline mode.
When the app goes online, I need to synchronize its database with the central db, and to avoid conflicts and to be able to use a synchronization tool I found, the simplest way is to use a UUID as primary key in each table.

So the UUID will look like '00a0e535-452d-11de-b01e-993b5c1a70e4', which will be stored in a char(36). Will this impact a lot the performance on selects, joins etc?

I've read many times that auto-incremented integer are more efficient than strings when used in primary keys. If I convert the UUID into an integer (because it's composed of hexadecimal digits), can this be more efficient?

Thanks in advance for your answers.

Options: ReplyQuote


Subject
Views
Written By
Posted
UUID as a primary key
41551
B J
May 20, 2009 06:51AM
20251
May 20, 2009 07:55AM
15245
B J
May 20, 2009 08:29AM
15359
May 20, 2009 08:44AM
12536
B J
May 20, 2009 09:04AM
14038
May 20, 2009 09:50AM
10537
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.