0

I am developing a classified website using ASP.NET and DB is MYSQL. I have a header table for store common details of ads. So here is my header table's database schema.

CREATE TABLE `test`.`header` (
  `header_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `title` VARCHAR (500) NOT NULL,
  `description` VARCHAR (5000) NOT NULL,
  `is_published` TINYINT (1) NOT NULL DEFAULT TRUE,

  //etc..

  PRIMARY KEY (`header_id`)
) ENGINE = INNODB CHARSET = latin1 COLLATE = latin1_swedish_ci ;

So I am using varchar(500) for title and varchar(5000) for description. So is it OK to use varchar 5000? Reason why I am asking this is some people are saying long varchar fields are converted to Text field inside MYSQL ( I dont know about this). How much is this long? Also some people are saying there is a limitation in row size. So is varchar(5000) field will lead to any performance issue?

Yes I can use Text field but remember I want a limitation for the description. otherwise users will copy paste a novel to description field. :)

What is your suggestion? Another data type or anything....

Thank you very much.

Prageeth Liyanage
  • 1,612
  • 2
  • 19
  • 41

1 Answers1

2

Assuming that 5000 characters is your limitation, then VARCHAR(5000) is perfectly reasonable.

Take a look at this question if you are curious about the differences between VARCHAR and TEXT: MySQL: Large VARCHAR vs. TEXT?.

Community
  • 1
  • 1
Nathan Taylor
  • 24,423
  • 19
  • 99
  • 156
  • Although the limitation needs to be managed at the asp end too, of course - otherwise users will find their 'novels' disappointingly truncated! – Strawberry Jan 27 '15 at 08:44