Why should I use VARCHAR over TEXT in MySQL?

I noticed that in MySQL both VARCHAR and TEXT offer variable size data. Well, VARCHAR is slightly more efficient in data storage, but nevertheless, TEXT MEDIUMTEXT and LONGTEXT offer much more features. So what are the real possibilities of using VARCHAR?

+3
source share
1 answer

First of all, you should read 10.4. String types in the MySQL manual: it will provide you with all the information you are looking for:


Some important differences:

  • The difference in the amount of text that may contain:
    • varchar ; MySQL, 64 , varchar - .
    • , - 2 ^ 32 .
  • , ; :


, , varchar, varchar.

+8

Source: https://habr.com/ru/post/1739689/


All Articles