91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Oracle Hint學習之二(忽略hint的情形)

發布時間:2020-07-25 08:42:12 來源:網絡 閱讀:385 作者:llc018198 欄目:關系型數據庫
  1. 在非分區索引上使用并行hint:

    如下全表掃描并行hint可以生效:

SQL> select /*+ full(dept) parallel(dept 2) */deptno from dept;
Execution Plan
----------------------------------------------------------
Plan hash value: 587379989
-------------------------------------------------------------------------------------------------------------
| Id  | Operation     | Name| Rows| Bytes | Cost (%CPU)| Time|    TQ  |IN-OUT| PQ Distrib |
--------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     ||     4 |    12 |     2   (0)| 00:00:01 | ||     |
|   1 |  PX COORDINATOR      ||||     || ||     |
|   2 |   PX SEND QC (RANDOM)| :TQ10000 |     4 |    12 |     2   (0)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
|   3 |    PX BLOCK ITERATOR ||     4 |    12 |     2   (0)| 00:00:01 |  Q1,00 | PCWC |     |
|   4 |     TABLE ACCESS FULL| DEPT|     4 |    12 |     2   (0)| 00:00:01 |  Q1,00 | PCWP |     |
--------------------------------------------------------------------------------------------------------------
Statistics
----------------------------------------------------------
 11  recursive calls
  0  db block gets
  5  consistent gets
  6  physical reads
  0  redo size
594  bytes sent via SQL*Net to client
523  bytes received via SQL*Net from client
  2  SQL*Net roundtrips to/from client
  0  sorts (memory)
  0  sorts (disk)
  4  rows processed

非分區索引使用并行hint無效:

SQL> select /*+ index(dept pk_dept) parallel(dept 2) */deptno from dept;
Execution Plan
----------------------------------------------------------
Plan hash value: 2913917002
----------------------------------------------------------------------------
| Id  | Operation | Name    | Rows  | Bytes | Cost (%CPU)| Time   |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT |   | 4 |12 | 1   (0)| 00:00:01 |
|   1 |  INDEX FULL SCAN | PK_DEPT | 4 |12 | 1   (0)| 00:00:01 |
----------------------------------------------------------------------------
Statistics
----------------------------------------------------------
 62  recursive calls
  0  db block gets
 59  consistent gets
  0  physical reads
  0  redo size
594  bytes sent via SQL*Net to client
523  bytes received via SQL*Net from client
  2  SQL*Net roundtrips to/from client
  7  sorts (memory)
  0  sorts (disk)
  4  rows processed

use_hash中指定被驅動表錯誤,hint無效:

SQL> select /*+ use_hash(t2) */ t1.empno,t1.ename,t2.loc from emp t1,dept t2 where t1.deptno=t2.deptno and t2.loc='CHICAGO';
6 rows selected.
Execution Plan
----------------------------------------------------------
Plan hash value: 844388907
----------------------------------------------------------------------------------------
| Id  | Operation     | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |       |     5 |   120 |     6(17)| 00:00:01 |
|   1 |  MERGE JOIN     |       |     5 |   120 |     6(17)| 00:00:01 |
|*  2 |   TABLE ACCESS BY INDEX ROWID| DEPT    |     1 |    11 |     2 (0)| 00:00:01 |
|   3 |    INDEX FULL SCAN     | PK_DEPT |     4 |       |     1 (0)| 00:00:01 |
|*  4 |   SORT JOIN     |       |    14 |   182 |     4(25)| 00:00:01 |
|   5 |    TABLE ACCESS FULL     | EMP     |    14 |   182 |     3 (0)| 00:00:01 |
----------------------------------------------------------------------------------------
因hash連接只適用等值關聯,所有hint無效:而走NL
SQL> select /*+ use_hash(t1) */ t1.empno,t1.ename,t2.loc from emp t1,dept t2 where t1.deptno>=t2.deptno and t2.loc='CHICAGO';
6 rows selected.
Execution Plan
----------------------------------------------------------
Plan hash value: 4192419542
---------------------------------------------------------------------------
| Id  | Operation   | Name | Rows  | Bytes | Cost (%CPU)| Time  |
---------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |  |7 |   168 |6   (0)| 00:00:01 |
|   1 |  NESTED LOOPS   |  |7 |   168 |6   (0)| 00:00:01 |
|*  2 |   TABLE ACCESS FULL| DEPT |1 |    11 |3   (0)| 00:00:01 |
|*  3 |   TABLE ACCESS FULL| EMP  |7 |    91 |3   (0)| 00:00:01 |

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


正確如下:

SQL> select /*+ use_hash(t1) */ t1.empno,t1.ename,t2.loc from emp t1,dept t2 where t1.deptno=t2.deptno and t2.loc='CHICAGO';
6 rows selected.
Execution Plan
----------------------------------------------------------
Plan hash value: 615168685
---------------------------------------------------------------------------
| Id  | Operation   | Name | Rows  | Bytes | Cost (%CPU)| Time  |
---------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |  |5 |   120 |6   (0)| 00:00:01 |
|*  1 |  HASH JOIN   |  |5 |   120 |6   (0)| 00:00:01 |
|*  2 |   TABLE ACCESS FULL| DEPT |1 |    11 |3   (0)| 00:00:01 |
|   3 |   TABLE ACCESS FULL| EMP  |    14 |   182 |3   (0)| 00:00:01 |

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

自相矛盾的hint會忽略掉:

SQL> select /*+ full(dept) index_ffs(dept pk_dept) */ deptno from dept;

Execution Plan

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

Plan hash value: 2913917002

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

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

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

|   0 | SELECT STATEMENT |   | 4 | 12 | 1   (0)| 00:00:01 |

|   1 |  INDEX FULL SCAN | PK_DEPT | 4 | 12 | 1   (0)| 00:00:01 |

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

Statistics

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

 1  recursive calls

 0  db block gets

 2  consistent gets

 0  physical reads

 0  redo size

594  bytes sent via SQL*Net to client

523  bytes received via SQL*Net from client

 2  SQL*Net roundtrips to/from client

 0  sorts (memory)

 0  sorts (disk)

 4  rows processed


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

奉新县| 胶南市| 鄂温| 阿瓦提县| 肃宁县| 齐齐哈尔市| 西吉县| 井陉县| 江安县| 鹤岗市| 聊城市| 北辰区| 拉孜县| 曲阳县| 龙州县| 贺兰县| 漳州市| 永顺县| 丘北县| 凤山市| 大安市| 日土县| 车险| 临漳县| 当涂县| 三门县| 安仁县| 梓潼县| 广州市| 新干县| 鞍山市| 布尔津县| 定日县| 那坡县| 霞浦县| 朝阳市| 靖州| 紫金县| 龙井市| 佛坪县| 柘荣县|