3

I am using UUID as the primary key in one of the tables.
What are the pros-cons of having this field as a varchar/varbinary/blob?

Swati
  • 41
  • 1
  • 3
  • In fact, are you sure you want to use UUID as the primary key? If you are using InnoDB, it is a poor choice for performance due to the nature of clustered index. – tszming Aug 12 '10 at 06:50
  • Yes, UUID is the way to go for this table. – Swati Aug 12 '10 at 08:08

1 Answers1

5

The difference between text-based and binary-based UUID is a significant number of bytes - 16 for binary representation vs. 30+ for text - so binary is the way to go. I would opt for VARBINARY over BLOB - if only 'cause VARBINARY is the newer type (and coming from a SQL Server background, I know VARBINARY there can be stored in-row).

Will A
  • 24,780
  • 5
  • 50
  • 61