views:

76

answers:

1

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?

DB: MYSQL.

TIA

+2  A: 

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
I agree, would not use a blob.
Remy
is there a difference in performance when using varchar and varbinay?