September 12, 2008 at 1:51 am
Is there any difference (locks, performance) between using NOLOCK hint inside view (for each table used in view) and using NOLOCK hint when selecting from view (withou hints inside)?
September 12, 2008 at 11:21 am
Not that I know of. Both can mess up your data in the same ways, so it's a pretty safe bet that both will have the same effect on performance.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
September 12, 2008 at 11:49 am
Assuming you're not talking about a materialized view, then there should be no difference whatsoever, since during the compile phase of the outer query, the reference to the view is replaced by the text of the view, and then the "new" outer query is compiled on its own.
And - I fully agree with all of the caveats brought up by Gsquared.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
September 12, 2008 at 12:01 pm
Of course, I use this hint only when I don't need accurate data - in my case this is acceptable for some reports.
Thanks for replies.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply