MySQL: Large VARCHAR vs TEXT?

By | February 1, 2013

If you have to store big texts in MySQL you have to choose in between using a big VARCHAR column and the TEXT type. So what are the differences between using for example a VARCHAR(2000) and TEXT?

The difference between TEXT and the VARCHAR type is how MySQL is storing the data. TEXT (and BLOB) data is stored off the table, leaving only a pointer to the actual storage.

So using VARCHAR is faster when the size of the data is reasonable. How big the performance difference is depends on the data and the used hardware.

Due the row length limit of 65,535 bytes the data you can store in the table itself is limited (Using utf8 2000 chars could use up to 6000 bytes).

One thought on “MySQL: Large VARCHAR vs TEXT?

  1. erin

    But what about in RDS? Programmers w/o a DBA use RDS in the cloud. And frameworks prefer TEXT…..

    thoughts?
    thanks,
    erin

    Reply

Leave a Reply