I'm trying to store a sequence of numbers like e.g. '15,3,425,20' in mySQL. I don't want to store it as a string in a varchar because of storage-size. (my sequence only contains numbers, no characters!)
What I'm trying to do is to convert the numbers into a 2Byte binary form:
15 = 0000000000001111
3 = 0000000000000011
425 = 0000000110101001
20 = 0000000000010100
My data would now look like this:
0000000000001111000000000000001100000001101010010000000000010100
I'm using always 2Bytes for all numbers. Like this I'm able to cut them again apart lateron.
But now my question: What kind of data type in mySQL should I use to store this binary data? AFAIK varchar(256) BINARY is just the case-insensitive variation of the regular varchar and it would not treat my data as 'real' binary data.
If you're now thinking "hey, what's this guy all talking about?!!" and you got a better idea how to store a sequence of numbers in an efficient way, please let me know!
thanks a lot!