store TEXT/BLOB in same table or not?

后端 未结 2 1133
感情败类
感情败类 2020-12-14 19:33

While searching trough SO, I\'ve found two contradicting answers (and even a comment that stated that) but no definitive answer:

The problem is: is there any perform

2条回答
  •  星月不相逢
    2020-12-14 19:53

    If available on your MySQL version, use the InnoDB Barracuda file format using

    innodb_file_format=barracuda
    

    in your MySQL configuration and set up your tables using ROW_FORMAT=Dynamic (or Compressed) to actually use it.

    This will make InnoDB to store BLOBs, TEXTs and bigger VARCHARs outside the row pages and thus making it a lot more efficient. See this MySQLperformanceblog.com blog article for more information.

    As far as I understand it, using the Barracuda format will make storing TEXT/BLOB/VARCHARs in separate tables not valid anymore for performance reasons. However, I think it's always good to keep proper database normalization in mind.

提交回复
热议问题