2

I would like to store dataset inside my table about the topic status [NEW, OLD, EDITED], Do i use VARCHAR(6) or TINYTEXT? and for image paths like [/image/name.png] and descriptions, Do i use text or varchar?

Calibur Victorious
  • 638
  • 1
  • 6
  • 20
  • 2
    Possible duplicate of [varchar(255) vs tinytext/tinyblob and varchar(65535) vs blob/text](http://stackoverflow.com/questions/7755629/varchar255-vs-tinytext-tinyblob-and-varchar65535-vs-blob-text) – Xenyal Mar 14 '17 at 07:44
  • 1
    Also related http://stackoverflow.com/questions/1203710/which-datatype-is-better-to-use-text-or-varchar – fvu Mar 14 '17 at 07:45
  • @Xenyal "Storage TEXT data types are stored as separate objects from the tables and result sets that contain them. This storage is transparent" Does that mean that TEXT is better for image path? but VARCHAR is better for Descriptions? – Calibur Victorious Mar 14 '17 at 07:46
  • @fvu "If your strings will never exceed some upper limit of characters, then go with VARCHAR" So what i understand is that anything less or equal to 64k length should be used as VARCHAR, But they keep saying that TEXT is for stored separate objects, Does that go with images paths? – Calibur Victorious Mar 14 '17 at 07:51

1 Answers1

1

Instead of tinytext use varchar. It's the good practice

Adnan Shawkat
  • 188
  • 1
  • 12
  • Is there anything that actually uses TEXT values? I never saw anything that uses anything more than 64k length, Or even near to 25k. – Calibur Victorious Mar 14 '17 at 07:51
  • @CaliburVictorious well actually it depends on the data that you're going to store. You can have more idea about such thing I think by reading this post. http://stackoverflow.com/questions/13932750/tinytext-text-mediumtext-and-longtext-maximum-storage-sizes – Adnan Shawkat Mar 14 '17 at 08:55