您的位置:首页 > 其它

no_merge/merge vs no_unnest/unnest

2016-04-09 15:49 337 查看
I sometimes get confused about the difference between (no_)merge and(no_)unnest.
I just do some test here to make the difference clearly.

The original sql and its plan are below. I’ll hint the sql with no_merge andno_unnest.
You will find the difference quickly.

I try the hint no_merge in
order to avoid merging the subquery. This obviously don’t work.

19

Then I try the hint no_unnest.
It works now. That means (no_)unest works
only in the where clause. So I guess (no_)merge is
only suitable after the from.

I do another test with the original sql below:

you will see the no_unest hint
doesn’t work.

Now I hint the original sql with the hint no_merge.
It works. That’s it!

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息