开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜