Quote from: groundup on November 19, 2002, 03:46:08 AMI didn't check but I thought I saw it using something other than tinyint(1), which would be boolean. Wouldn't tinyint(1) unsigned mean from 0-9? does the 1 signify a digit/place/character?
tinyint(1) would have one of two meanings.
The first is how many bits. If this is what it means, tinyint(1) would, indeed represent 1 bit - which would be boolean, and therefore useless in this circumstance (meaning two values is insufficient - we need 3 values for this system). I'm fairly certain, however, that in mysql, tinyint is always restricted to 1 byte lengths - which is 8 bits.
Likely the 1 refers to how many bytes - specifically with respect to how many ascii characters it can contain.
I think you are misunderstanding the way the data is stored. If it's storing the ascii value of a number, it's actually storing 0x30 <digit> for each character (i.e. 36 would be stored as 0x33 0x36 taking up two bytes). If it's storing the integral value, it stores the value. So 36 would be stored as 0x24 taking up one byte.
Essentially, if the field is a tinyint, it's as efficient as it's going to get.