SQL连接与单个表:性能差异?

编程入门 行业动态 更新时间:2024-10-25 09:30:21
本文介绍了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连接与单个表:性能差异?

本文发布于:2023-10-16 06:00:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496697.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:差异   性能   SQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!