MySQL Forums :: Performance :: UUID as a primary key

Advanced Search

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 35507 B J 05/20/2009 06:51AM
Re: UUID as a primary key 17770 Aftab Khan 05/20/2009 07:55AM
Re: UUID as a primary key 13801 B J 05/20/2009 08:29AM
Re: UUID as a primary key 13865 Rick James 05/20/2009 08:44AM
Re: UUID as a primary key 11280 B J 05/20/2009 09:04AM
Re: UUID as a primary key 12608 Rick James 05/20/2009 09:50AM
Re: UUID as a primary key 9439 B J 05/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.