当SQL查询受到限制而调用整个行时,性能会提高吗? [英] Performance benefit when SQL query is limited vs calling entire row?

查看:58
本文介绍了当SQL查询受到限制而调用整个行时,性能会提高吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过仅选择查询中的必填字段而不查询整个行,可以带来多少性能收益?例如,如果我有一行10个字段,但只需要显示5个字段,是否值得仅查询这5个字段?有了此限制,性能带来的好处是什么?如果需要,以后又不得不返回并在sql查询中添加字段的风险呢?

How much of a performance benefit is there by selecting only required field in query instead of querying the entire row? For example, if I have a row of 10 fields but only need 5 fields in the display, is it worth querying only those 5? what is the performance benefit with this limitation vs the risk of having to go back and add fields in the sql query later if needed?

推荐答案

这不仅仅是您需要考虑的额外数据方面.选择所有列将否定覆盖索引的用处,因为将需要对聚集索引(或表)进行书签查找.

It's not just the extra data aspect that you need to consider. Selecting all columns will negate the usefulness of covering indexes, since a bookmark lookup into the clustered index (or table) will be required.

这篇关于当SQL查询受到限制而调用整个行时,性能会提高吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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