Jump to content

Text vs Varchar


klepec

Recommended Posts

TEXT was designed for the purpose of storing large chunks of text.

 

In earlier versions of MySQL (< 5.0), VARCHAR was limited to 255 characters.  If backwards compatibility is important, don't use it for large text columns.

 

Both VARCHAR and TEXT support FULLTEXT indices.  So there aren't any text search benefits to either.

 

However, VARCHAR indices (other than FULLTEXT) are a bit faster, so VARCHAR outperforms TEXT on shorter bits of text, e.g. names and tokens.

 

Overview:

- If you want backwards compatible, use TEXT

- If not, use either

Link to comment
https://forums.phpfreaks.com/topic/264406-text-vs-varchar/#findComment-1355050
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.