I have a MySQL table where rows are inserted dynamically. Because I cannot be certain of the length of strings and do not want them cut off, I make them varchar(200) which is generally much bigger than I need.
Is there a big performance hit in giving a varchar field much more length than necessary?
No, in the sense that if the values you’re storing in that column are always (say) less than 50 characters, declaring the column as
varchar(50)orvarchar(200)has the same performance.