Entries in my table are uniquely identified by word that is 5-10 characters long and I use TINYTEXT(10) for the column. However, when I try to set it as PRIMARY key I get the error that size is missing.
From my limited understanding of the docs, Size for PRIMARY keys can be used to simplify a way to detect unique value i.e. when first few character (specified by Size) can be enough to consider it unique match. In my case, the size would differ from 5 to 10 (they are all latin1 so they are exact byte per character + 1 for the lenght). Two questions:
- If i wanted to use TINYTEXT as PRIMARY key, which
sizeshould I specify? Maximum available - 10 in this case? Or should be thesizestrictly EXACT, for example, if my key is 6 character long word, but I specifySizefor PK as 10 - it will try to read all 10 and will fail and throw me an exception? - How bad performance-wise would be to use [TINY]TEXT for the PK? All Google results lead me to opinions and statements "it is BAD, you are fired", but is it really true in this case, considering TINYTEXT is 255 max and I already specified max length to 10?