本文介绍了您对根据某个类别 id 将大型 SQL 表分解为几个有什么想法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个大表,为许多网站上的许多不同存储过程提供服务,但通常只处理表中与使用它的网站相关的数据.

We have a large table that services many different stored procedures on lots of websites, but generally only deal with data in the table that relates to the website using it.

也就是说,按websiteID拆分表格会不会错?

In other words, would it be wrong to split the table by websiteID?

推荐答案

如果这意味着您要在多台服务器上安装多个数据库,那么这是推荐的扩展方式之一.如果你的意思是在同一台服务器上有多个表(相同的数据库或不同的),你的收益将很小,如果有的话;并且您的管理开销可能会增加以保持同步.如果所有查询都遇到多个表的情况,那么效率就会降低.

If it means you are installing multiple databases on multiple servers, then that's one of the recommended ways to scale. If you mean multiple tables on the same server (same database or not), your gain will be little if any; and your administrative overhead will probably increase to keep them in synch. And if there are any cases at all of queries that hit multiple tables, those will be less efficient.

无论是好是坏,效果都不太可能是实质性的.你期望得到什么好处?(顺便说一下,这是一个典型的 rdbms 反模式,用于过早优化.)

The effect is not likely to be substantial either for good or ill. What would you expect to be the benefit? (This is a typical rdbms antipattern for premature optimization, by the way.)

这篇关于您对根据某个类别 id 将大型 SQL 表分解为几个有什么想法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 23:18