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

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

问题描述

我听说了很多关于为了提高某些应用程序的性能而进行的非规范化.但我从未尝试过做任何相关的事情.

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

所以,我只是好奇,规范化数据库中的哪些地方会使性能变差,或者换句话说,什么是非规范化原则?

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

  • 非规范化视图
  • 预计算列

与任何此类方法一样,这改进了读取数据(因为它们随时可用),但更新数据变得更加昂贵(因为您需要更新复制的数据)或预先计算的数据).

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天全站免登陆