0

I would like to store 1000+ records in a table. It has got:

ID : auto increment INT title : varchar (20) author_ID : INT timestamp : unsigned INT text : TEXT (this is the problem) (+tags and categories)

The "text" field has to store about 30-50 KByte texts. But I don't want to search in this field, only in the other ones. Is it a good idea, to store these big texts in .TXT files? Will the database queries be faster?

DevinPHP
  • 37
  • 3

2 Answers2

2

TEXT and BLOB are stored off the table.

There is only a pointer to the location of the actual storage. I don't think that you have to worry too much, especially if you have only around 1 thousand records.

Anyway, referring to this post, if your data is always < 65 KByte, you can think about using VARCHAR.

It seems that it will have better performances.

More info in the linked Q&A.

kiks73
  • 3,718
  • 3
  • 25
  • 52
0

I would suggest MEDIUMTEXT because some day your 30-50K will grow to 70K. VARCHAR won't go that far

The way InnoDB structures things, there is rarely any not to keep text columns in the database. (Images are another matter.)

There is a pitfall wherein you JOIN two tables, then pare the resultset down with GROUP BY or LIMIT -- If you are carrying big text columns through the temp tables, this can be a performance problem.

Rick James
  • 135,179
  • 13
  • 127
  • 222