Ricardo Altamirano
Ricardo Altamirano

Reputation: 15198

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.

Upvotes: 0

Views: 161

Answers (1)

Mchl
Mchl

Reputation: 62369

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.

Upvotes: 1

Related Questions