MySQL Forums
Forum List  »  Newbie

UUID() Vs UUID_TO_BIN
Posted by: Norman Garcia
Date: October 25, 2018 08:36PM

Hi guys,

I want to use UUIDs as Pkeys, however want to know what would be the best practice, between these 2 options:

1. I can set my field as nvarchar(36), and use the UUID() function each time I need to create a new key.

2. I can set my field as binary(16) and use the UUID_TO_BIN / BIN_TO_UUID to create and query keys.

What would be best practice?

Thanks

Options: ReplyQuote


Subject
Written By
Posted
UUID() Vs UUID_TO_BIN
October 25, 2018 08:36PM
October 25, 2018 10:04PM
October 26, 2018 10:28AM
October 26, 2018 11:29AM


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.