VARCHAR versus TEXT or LONGTEXT

17,515

TEXT is stored off the table it has reference of it only.

While

VARCHAR is stored inline with the table and usually used with less size. You can use it to max 65535 but very bad actually in terms of performance.

So that you can optimized table and queries, performance may very with DBMS. If you have variable but larger string I would suggest using TEXT

Share:
17,515
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    If a blog post is 200 characters long, will varchar(6500) only consume the space of varchar(200)?

    Will this be more efficient than using TEXT or LONGTEXT?