Oracle 11g R2 full outer join Optimization execution Plan (iii) Native_full_outer_join tips

Source: Internet
Author: User
Tags hash join sorts

Although the previous article introduced the Native_full_outer_join and no_native_full_outer_join two hint, but in fact Native_full_outer_join did not play any role, Because Oracle's optimization of the full outer join makes the new execution plan less costly than the original execution plan, Oracle chooses the execution plan by default, so it does not see the effect of the native_full_outer_join hint.

Sql> SET Autot on

Sql> SELECT T1.id, t2.id

2 from T1 full OUTER JOIN T2

3 on t1.id = T2.id;

ID ID

--------------------

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9

10

1

0

11 rows have been selected.

Execution plan

----------------------------------------------------------

Plan Hash value:53297166

----------------------------------------------------------------------------------

| Id | Operation | Name | Rows | Bytes | Cost (%CPU) | Time |

----------------------------------------------------------------------------------

| 0 |          SELECT STATEMENT |     |   9 |     234 | 9 (12) | 00:00:01 |

|  1 | VIEW |     Vw_foj_0 |   9 |     234 | 9 (12) | 00:00:01 |

|* 2 |          HASH JOIN Full outer|     |   9 |     234 | 9 (12) | 00:00:01 |

This column more highlights: http://www.bianceng.cn/database/Oracle/

|    3 | TABLE ACCESS Full |     T1 |   9 |     117 | 4 (0) | 00:00:01 |

|    4 | TABLE ACCESS Full |     T2 |   9 |     117 | 4 (0) | 00:00:01 |

----------------------------------------------------------------------------------

predicate information (identified by Operation ID):

---------------------------------------------------

2-access ("T1".) ID "=" T2 "." ID ")

Note

-----

-Dynamic sampling used for this statement (level=2)

Statistical information

----------------------------------------------------------

0 Recursive calls

0 db Block gets

Consistent gets

0 physical Reads

0 Redo Size

733 Bytes sent via sql*net to client

520 bytes received via sql*net from client

2 sql*net roundtrips To/from Client

0 Sorts (memory)

0 Sorts (disk)

Rows processed

Attempt to execute in Rbo case:

Sql> ALTER session SET Optimizer_mode = CHOOSE;

The session has changed.

Sql> SELECT T1.id, t2.id

2 from T1 full OUTER JOIN T2

3 on t1.id = T2.id;

ID ID

--------------------

2 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.