7 messages in com.mysql.lists.javabinary index
FromSent OnAttachments
David Parker06 Dec 2002 09:43 
Dorel Vaida08 Dec 2002 22:51 
David Parker09 Dec 2002 06:02 
Arthur Fuller09 Dec 2002 10:26 
Udkik10 Dec 2002 02:06 
Dorel Vaida10 Dec 2002 02:45 
Arul10 Dec 2002 03:09 
Subject:binary index
From:David Parker (da@rbii.com)
Date:12/06/2002 09:43:32 AM
List:com.mysql.lists.java

In my application everything has a UUID, a 128-bit indentifier. I want to store these as keys in my MySQL/InnoDB tables.

What I have been doing is just converting the UUIDs to 32 character hex strings, and defining the keys in the tables as char(32). Since IDs are a big component of the data, having to use a hex string almost doubles the size of my tables, in some cases.

If I use a char(16) and just populate the key field with PreparedStatement.setBytes(), the indexing, etc. seems to work fine, but the key is not human-readable. I tried using a tinyblob, but InnoDB can't use that as a primary key, apparently.

Has anybody done anything similar to this? Ideally, I would be able to store the UUID as a fixed length blob (16 bytes), and use something like a to_hex_string() function on the key when I wanted to look at things from the mysql shell....

- DAP

"If you want sense, you'll have to make it yourself." The Dodecahedron