If I set a column as varchar(50) say, then update it with a string of length 20 say. Then OPTIMISE it. What will happen if I then UPDATE it with a string of more than 20, say 30?
(because the optimise is supposed to get rid of excess baggage on the varchars...)
Second question: What happens if I have a varchar(50) and UPDATE with a string of 51 characters?
Third question: The manual is unclear here, but what is the true maximum optimal string size for varchar? is it 256 or 254 (because of the extra 2 bytes it needs) or is it something else?
"In contrast to CHAR, VARCHAR values are stored as a one-byte or two-byte length prefix plus data. The length prefix indicates the number of bytes in the value. A column uses one length byte if values require no more than 255 bytes, two length bytes if values may require more than 255 bytes."
Thanks.