For storing a 128 bits UUID there are multiple storage options:
- a byte[16] column
- two bigint/long(64 bits) columns
- a CHAR(36) column - 32 hex digits + 4 dashes.
- a UUID database specific column, if db supports it
From an indexing point of view which of those are the most efficient? If the db doesn't support a dedicated uuid type which of 1, 2, 3 are the best candidates?