开发者

Is there a fixed length version of MySQL's CHAR data type that can store more than 255 characters?

开发者 https://www.devze.com 2023-03-24 22:46 出处:网络
I know about VARCHAR, TEXT, etc. but I\'m hoping for something that has a fixed width because I value the boost in efficiency, even if it\'s minor. I can\'t seem to find anything in the documentation,

I know about VARCHAR, TEXT, etc. but I'm hoping for something that has a fixed width because I value the boost in efficiency, even if it's minor. I can't seem to find anything in the documentation, and my only other option is to split a message into pieces 开发者_如何学编程and store each in a separate column.


No, there is no such datatype. Did you actually measure if using CHAR in place of VARCHAR gives you any measurable performance gain? Remember what they say about premature optimization?

Splitting message into many columns and then stitching it together will probably be slower, than any increase in speed gained from using CHAR instead of VARCHAR.

0

精彩评论

暂无评论...
验证码 换一张
取 消