美文网首页
Oracle調優看什麽

Oracle調優看什麽

作者: 马云生 | 来源:发表于2020-06-27 12:12 被阅读0次

获取执行计划:

select * from table(dbms_xplan.display);

select * from v$sql;//sql_id取得,以及下面第二个参数0或者其他数字

select * from table(dbms_xplan.display_cursor('sql_id',0,format=>'ALL'));

執行計劃解析順序

    ◆從内到外

    ◆從上到下

The order of the operations is 4,5,3,6,2,9,10,8,7,1,0.

看什麽

1.Full Table Scans

The entire table is read up to the high water mark(HWM).The HWM marks the last block in the table that has ever had data written to it. If you have deleted all the rows in a table you will still read up to the HWM.

2.Join Methods, Join Order

     2-1.Nested Loop 

          First return all the rows from row source 1(Driving Table), typically the smaller of the two row sources.

        Then Probe row source 2(Inner Table) once for each row returned from row source 1.

       Good for joining smaller row sources.

       Best used with indexed foreign key columns.

     2-2.Hash Join

        Smallest row source is chosen and used to build a hash table(in memory) and a bitmap.

        The second row source is hashed and checked against the hash table looking for joins. The bit map is used as a quick lookup to check if rows are in the hash table.

        Good for joining larger row sources.

         Needs PGA memory.

     2-3.Sort Merge Join

           Rows are produced by row source 1 and are then sorted.

           Rows from row source 2 are then produced and sorted by the sort key as Row Source 1.

          Row source 1 and 2 are not accessed concurrently. Sorted rows from both sides are then merged together.

           Needs PGA Memory.

     2-4.Cartesian Join

           Every row from one row source is joined to every row from the second row source.

          Usually the result of a poorly written join.

3.Index Access Methods

Index Range Scan

Index Unique Scan

Index Full Scan

Index Fast Full Scan

Index Skip Scan

4.Filters

   Restriction in the where clause.

    try to filter rows before performing joins and this the goal.

5.Parallel Operations

     Some SQL processing can be broken into separate parallel processing steps.

     Parallel processing can be hinted.

     Some operations that might be seen in the execution plan:

         PX COORDINATOR

         PX BLOCK ITERATOR

         PX SEND

        PX RECEIVE

6.Partition Processing

     Common practice to partition tables that are expected to contain a large volume of rows.

     The optimizer is partition-smart, and its plans should reflect this(Partition Pruning)

     Partition access in the execution plan:

          PARTITION LIST SINGLE

          PARTITION LIST ALL

7.Dynamic Statistics

    Indicates object statistics are missing.

8.Cost

     Used to compare different plans for the same query.

    IOs,CPU,and network..

相关文章

  • Oracle調優看什麽

    获取执行计划: select * from table(dbms_xplan.display); select *...

  • 摄影调色原理篇

    爲什麽要調色? 1.更好的實現攝影創意意圖 2.對色彩進行選擇和搭配 影調是什麽? 1.照片的基調,反應明暗關係層...

  • 平凡中的智慧

    這兩天的情緒不太調整的過來,總是悶悶的,思前想後也想不到是為什麼會這樣。索性不想了,該做什麽做什麽,做著做著也就通...

  • 龙虾的爱情

    這個傢伙,要讓自己變得優秀起來。那他現在是什麽狀態?在變優秀的路上、、、 01 关于龙虾 龙虾,海里生物的一种。 ...

  • 六篇文章彙總

    這兩日關於人口政策方面的消息與文章特多,原因大概是中國最新一輪出臺生育優惠政策。對於什麽“優惠”,我並不太關心。我...

  • 未来创科人才所需要的知识

    创科人才是什麽东东呢?不知道大家会否总是听到什麽创科人才,什麽智慧城市之类,人才当然大家都知道是什麽,就是对于机构...

  • 2019-11-26

    “你擔心什麽,什麽就控制你。” 約翰·洛克 ​​​

  • 装什麽就成什麽【转】

    有位木匠砍了一树,把它做了三个木桶。 一个装水,就叫水桶,大家用着, 一个装酒,就叫酒桶,大家抢着、 捧着、 品着...

  • 《是什麽》

    是什麼, 讓你猶如火焰, 灼傷了綠葉紅花。 是什麼, 讓你猶如刺猬, 刺傷了稚嫩幼芽。 是什麼, 讓你猶如烈日, ...

  • 《我變成了笨蛋》——不要被骗了

    人至少會有壹個優點值得驕傲,什麽都好,要去找到它; 讀書不好,可以運動; 如果都不行,妳至少善解人意; 抱著夢想,...

网友评论

      本文标题:Oracle調優看什麽

      本文链接:https://www.haomeiwen.com/subject/vbmmfktx.html