MySQL性能:单表或多表

发布于 2024-07-29 07:02:29 字数 198 浏览 1 评论 0原文

我有8组数据,每组大约30,000行,数据的结构相同,只是对于不同的语言。

网站的前端会获得比较高的流量。

所以我的问题是关于 MySQL 性能,我是否应该有一个包含一列的表来区分数据属于哪个集合(即列“语言”)或为每个语言集创建单独的表?

(如果可能的话,解释一下为什么会很有帮助)

提前致谢 沙迪

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

街道布景 2024-08-05 07:02:29

我会选择单桌设计。 无论表有多“宽”,具有适当索引的查找时间都应该完全相同。

除了性能问题之外,这还将简化设计以及与其他表(外键等)的关系。

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).

多情出卖 2024-08-05 07:02:29

“每种语言一个表”设计的另一个缺点是每次添加一个表时都必须更改架构。

语言列意味着您只需添加数据,这不会造成干扰。 后者是要走的路。

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.

洒一地阳光 2024-08-05 07:02:29

我也会选择单桌设计。 由于 language_key 的基数非常低,因此我将通过 language_key 对表进行分区,而不是定义索引。 (如果您的数据库支持。)

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.)

金兰素衣 2024-08-05 07:02:29

我同意其他回复 - 我会使用一张桌子。 关于性能优化,许多因素都可能对性能产生更大的影响:

  • 适当的索引
  • 编写/测试以提高查询效率
  • 选择适当的存储引擎文件系统
  • 的硬件
  • 类型和配置
  • 优化 mysql 配置设置

...等等。我是 高性能 MySQL

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文