MySQL Table with TEXT column

后端 未结 6 588
太阳男子
太阳男子 2021-01-18 02:08

I\'ve been working on a database and I have to deal with a TEXT field.

Now, I believe I\'ve seen some place mentioning it would be best to isolate the TEXT column fr

6条回答
  •  佛祖请我去吃肉
    2021-01-18 02:41

    This is probably premature optimisation. Performance tuning MySQL is really tricky and can only be done with real performance data for your application. I've seen plenty of attempts to second guess what makes MySQL slow without real data and the result each time has been a messy schema and complex code which will actually make performance tuning harder later on.

    Start with a normalised simple schema, then when something proves too slow add a complexity only where/if needed.

    As others have pointed out the quote you mentioned is more applicable to query results than the schema definition, in any case your choice of storage engine would affect the validity of the advice anyway.

    If you do find yourself needing to add the complexity of moving TEXT/BLOB columns to a separate table, then it's probably worth considering the option of moving them out of the database altogether. Often file storage has advantages over database storage especially if you don't do any relational queries on the contents of the TEXT/BLOB column.

    Basically, get some data before taking any MySQL tuning advice you get on the Internet, including this!

提交回复
热议问题