MySQL Performance: Single table or multiple tables

断了今生、忘了曾经 提交于 2019-12-30 07:07:09

问题


I have a 8 sets of data of about 30,000 rows for each set, the data is the same structure just for different languages.

The front end of the site will get relatively high traffic.

So my question is regarding MySQL performance, if i should have a single table with one column to distinguish which set the data belongs to (i.e. coloumn "language") or create individual tables for each language set?

(an explanation on why if possible would be really helpful)

Thanks in advance Shadi


回答1:


I would go with single table design. Seek time, with proper index, should be exactly the same, no matter how "wide" table is.

Apart from performance issues, this will simplify design and relations with other tables (foreign keys etc).




回答2:


Another drawback to the "one table per language" design is that you have to change your schema every time you add one.

A language column means you just have to add data, which is not intrusive. The latter is the way to go.




回答3:


I'd go with one-table design too. Since the cardinality of the language_key is very low, I'd partition the table over language_key instead of defining an index. (if your database supports it.)




回答4:


I agree with the other responses - I'd use of a single table. With regards to performance optimization a number of things have the potential to have a bigger impact on performance:

  • appropriate indexing
  • writing/testing for query efficiency
  • chosing appropriate storage engine(s)
  • the hardware
  • type and configuration of the filesystem(s)
  • optimizing mysql configuration settings

... etc. I'm a fan of High Performance MySQL



来源:https://stackoverflow.com/questions/1170517/mysql-performance-single-table-or-multiple-tables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!