NO_MERGE hint without an argument

I just found out (by accident) that you can use the NO_MERGE optimizer hint in two ways:
  1. either in the surrounding query, where you're referencing the subquery (or view) that is not to be merged (here you've to add an argument specifying which subquery/view you mean)
  2. or in the query itself that is not to be merged (here you use the hint without an argument)
I've used only the first approach til now, but the latter is most useful too (eg. if you've a view that you want not to be merged anywhere in your application's queries ... using the second syntax you don't have to include the hint in all the queries where you use the view).

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thanks!

A co-worker passed this on and I put it to use right away.