The background is that from 2 or 3 unsigned integers I want something unique. I’ve done cantor pairs but they grow out of an BIGINT UNSIGNED when using 3.
Now I’m into hashing, first I went with MD5 and char(32) but know I’m into CRC32 with INT UNSIGNED since it’s numeric, therefore fast. The goal is high performance reading from this index.
Is hashing the only way? Can I maintain a reasonable collision probability for ~200,000 rows?
You can use
binary(12)(12 bytes) which can uniquely store three 4 byte integers.Or
decimal(30)which also can do that and doesn’t require you to first convert the integers to a binary encoding (just 0 pad them to 10 digits and append them together, MySql will do the conversion for you).