Explain plan for struct and array in Oracle

Source: Internet
Author: User

In previous articles, I introduced how to use struct to input multiple pieces of data to Oracle at a time in a Java program.

As we all know, at the end of the SQL statement, we need to make an explain Plan to ensure that there are no statements that affect performance.

The following method is used to explain struct and array:

1. Separate analysis:

Explain plan
Select * from table (dept_array (department_type (
1, -- DNO number (10 ),
'Name', -- name varchar2 (50 ),
'Location' -- location varchar2 (50)
) T;
Select * from table (dbms_xplan.display );

Result:

Plan_table_output
1 plan hash value: 1748000095
2
3 Cores ----------------------------------------------------------------------------------------------
4 | ID | operation | Name | rows | bytes | cost (% CPU) | time |
5 Cores ----------------------------------------------------------------------------------------------
6 | 0 | SELECT statement | 8168 | 16336 | 24 (0) | 00:00:01 |
7 | 1 | collection iterator constructor fetch |
8 bytes ----------------------------------------------------------------------------------------------

2. join other tables:

Explain plan
Select * from table (dept_array (department_type (
1, -- DNO number (10 ),
'Name', -- name varchar2 (50 ),
'Location' -- location varchar2 (50)
) T
Join Table2 T2 on T. DNO = t2.dno;
Select * from table (dbms_xplan.display );

 

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.