非正规化以什么方式提高数据库性能? [英] In what way does denormalization improve database performance?

查看:209
本文介绍了非正规化以什么方式提高数据库性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说了很多关于反规范化的问题,这是为了提高某些应用程序的性能。但我从来没有尝试过任何相关的事。

I heard a lot about denormalization which was made to improve performance of certain application. But I've never tried to do anything related.

所以,我只是好奇,在归一化DB的地方使性能更糟,或换句话说,什么是反规范原则?

So, I'm just curious, which places in normalized DB makes performance worse or in other words, what are denormalization principles?

如果我需要提高性能,如何使用这种技术?

How can I use this technique if I need to improve performance?

推荐答案

反规范化是一种时空折衷。规范化数据占用较少的空间,但可能需要连接构造所需的结果集,因此需要更多的时间。如果它是非规范化的,数据在几个地方复制。然后它占用更多的空间,但是数据的期望视图是容易获得的。

Denormalization is a time-space trade-off. Normalized data takes less space, but may require join to construct the desired result set, hence more time. If it's denormalized, data are replicated in several places. It then takes more space, but the desired view of the data is readily available.

还有其他时空优化,例如

There are other time-space optimizations, such as


  • / li>
  • 预计算列

与任何此类方法一样, / strong>(因为它们随时可用),但更新数据会变得更加昂贵(因为您需要更新已复制或预先计算的数据)。

As with any of such approach, this improves reading data (because they are readily available), but updating data becomes more costly (because you need to update the replicated or precomputed data).

这篇关于非正规化以什么方式提高数据库性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆