Queryplan for Oracle Analysis

Source: Internet
Author: User

Clear Shared pool:

Alter system flush shared_pool;

However, to clear the entire memory, we had to shut down the instances and databases in the entire Oracle RAC environment and restart them.

You can clear the buffer cache:

Alter system flush buffer_cache;

Analyze query plan,

Explain plan for select * fromHZCZRK_JBXXB, HZCZRK_ZPXXB WHERE HZCZRK_JBXXB.RYID = HZCZRK_ZPXXB.RYID;

Select plan_table_output fromtable (dbms_xplan.display ());

Expected result:

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

Bytes -----------------------------------------------------------------------------------------------------------

| 0 | select statement | 2898K | 572M | 240 K (1) | 00:48:06 |

| 1 | merge join | 2898K | 572M | 240 K (1) | 00:48:06 |

| 2 | table access by index rowid | HZCZRK_ZPXXB | 2898K | 146M | 120 K (1) | 00:24:07 |

| 3 | index full scan | INDEX_HZCZRK_ZPXXB | 2898K | 6771 (1) | 00:01:22 |

| * 4 | sort join | 2898K | 1200m | 2156M | 119 K (1) | 00:24:00 |

| 5 | table access full | HZCZRK_JBXXB | 2898K | medium M | 21194 (3) | 00:04:15 |

Bytes -----------------------------------------------------------------------------------------------------------

Predicate Information (identified byoperation id ):

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

4-access ("HZCZRK_JBXXB". "RYID" = "HZCZRK_ZPXXB". "RYID ")

Filter ("HZCZRK_JBXXB". "RYID" = "HZCZRK_ZPXXB". "RYID ")

After using set autotrace traceonly, you can view the execution plan and statistics, such as query:

Select count (*) FROM HZCZRK_JBXXB;. The execution plan and statistics are as follows:

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

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

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

| 0 | select statement | 1 | 9643 (2) | 00:01:56 |

| 1 | sort aggregate | 1 |

| 2 | index fast full scan | sys_c00000067 | 17M | 9643 (2) | 00:01:56 |

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

Statistics

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

1 recursive cballs

0 db block gets

37509 consistent gets

37485 physical reads

0 redo size

537 bytes sent via SQL * Net toclient

524 bytes received via SQL * Netfrom client

2 SQL * Net roundtrips to/fromclient

0 sorts (memory)

0 sorts (disk)

1 rows processed

Consistent gets indicates memory consumption, physicalreads indicates disk I/O consumption, and the Unit is data block (DB_BLOCK_SIZE)

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.