您推荐哪个1,为什么? [英] Which 1 do u recommend and why?

查看:56
本文介绍了您推荐哪个1,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为第二个性能比较好

您推荐哪个1,为什么?

I think performance wise 2nd is faster

Which 1 do you recommend and why?

SELECT * FROM CUSTOMER_BAK

SELECT * FROM dbo.CUSTOMER_BAK

推荐答案

您为什么认为性能会有所不同?您首先需要了解dbo在这种情况下的含义.在这里看看: http://msdn.microsoft.com/en -us/library/aa905208%28v = sql.80%29.aspx [
祝您好运!
Why do you think the performance would be different? You would first need to know what dbo means in this context. Have a look here: http://msdn.microsoft.com/en-us/library/aa905208%28v=sql.80%29.aspx[^]

If you care about good coding and also about performance you might take another look at "select *". You should explicitly select the fields you want, something like "select A, B, C from table ...". This way you''re sure you get the fields the way you want them (because no assumptions can be made on the defined field order of your table). Also, you get better performance by specifying only the fields needed and therefor don''t retrieve data from fields you do not need.

Good luck!


如此处所述
最差的做法-不与所有者限定对象
[ ^ ]限定对象的资格时,SQL不必查找对象,因此从性能角度考虑,最好使用限定名称.

使用合格的对象还可以100%明确您的意图.
As mentioned here
Worst Practice - Not Qualifying Objects With The Owner
[^] when you qualify the object SQL will not have to go looking for the object, so performance wise it will be better to use the qualified name.

Using qualified object will also make 100% clear what your intention is.


阿莫尔,
它与执行(预编译)之前的事项有关,而与运行时问题无关.因此,它们两个都以相同的性能执行.
Hi Amol,
It is something related to before execution (precompile) matters , and its not related to runtime issues. So both of them are executed with the same performance.


这篇关于您推荐哪个1,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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