I've read about this and transaction isolation level and was just wondering.....
I have some queries that query against products, categories, locations & stock.
Now the products, categories and locations data rarely changes, but as you can imagine, stock does.
Is it reasonable to specify WITH (NOLOCK)
on products, categories, locations but not specify it on Stock?
I've done some timings and it does seem to improve performance so I'm cautiously happy.
My understanding is that if I don't specify WITH (NOLOCK)
on Stock, that should only get committed transactions and not have dirty reads.
Whilst, as the other tables contents rarely change, it's safe to specify WITH (NOLOCK)
.
The specific proc I am working on doesn't write to any of the mentioned tables....it puts some results into a #table and returns rows from that.
Your thoughts appreciated.