Any advantage of using CHAR over VARCHAR?

CHAR is stored as a fixed-length string; VARCHAR is stored as a variable-length string. I can use VARCHAR to store a fixed-length string, but why do people still want to use CHAR to store a fixed-length string? Is there any use to using CHAR over VARCHAR? If none of the advantages, why doesn't mySQL database remove the CHAR parameter?

+5
source share
1 answer
  • VARCHAR

varchar stores a string of characters of variable length. it may require less memory than fixed-length types because it uses only as much space as it needs.

varchar 1 2 . , varchar (10) 11 . varchar , . , , , , . , ...

  • CHAR

char , mysql . CHAR MySQL . , .

char , . , CHAR MD5 , .

char , VARCHAR, , .

+5

All Articles