SQL连接与单个表:性能差异? [英] SQL Joins vs Single Table : Performance Difference?

查看:106
本文介绍了SQL连接与单个表:性能差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图坚持使数据库规范化的做法,但这导致需要运行多个联接查询.如果许多查询使用联接而不是调用可能包含冗余数据的单个表,会不会导致性能下降?

I am trying to stick to the practice of keeping the database normalized, but that leads to the need to run multiple join queries. Is there a performance degradation if many queries use joins vs having a call to a single table that might contain redundant data?

推荐答案

保持数据库规范化,直到您发现瓶颈.然后,只有在仔细分析后,您才能规范化.

Keep the Database normalised UNTIL you have discovered a bottleneck. Then only after careful profiling should you denormalise.

在大多数情况下,拥有良好的索引覆盖范围和最新的统计信息将解决大多数性能和阻塞问题,而不会进行任何非规范化.

In most instances, having a good covering set of indexes and up to date statistics will solve most performance and blocking issues without any denormalisation.

如果对表进行写入和读取操作,则使用单个表可能会导致性能下降.

Using a single table could lead to worse performance if there are writes as well as reads against it.

这篇关于SQL连接与单个表:性能差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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