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

溫馨提示×

溫馨提示×

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

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

使用autotrace查看執行計劃

發布時間:2020-08-11 04:31:12 來源:ITPUB博客 閱讀:122 作者:banana_62 欄目:關系型數據庫
set autotrace off
不產生autotrace報告,默認值
set autotrace on explain
autotrace報告只展示最優的執行方式(optimizer execution path)
SQL> set autotrace on explain;
—插入數據測試是否執行了sql
SQL> insert into scott.emp values('5566','explain','','','','','','');

1 row created.
—已經表明執行了sql
—只展示了執行計劃
Execution Plan
----------------------------------------------------------
---------------------------------------------------------------------------------
| Id  | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------
|   0 | INSERT STATEMENT | |     1 |   100 |     1   (0)| ss00:00:01 |
|   1 |  LOAD TABLE CONVENTIONAL | EMP | | |     | |
---------------------------------------------------------------------------------

SQL> select * from scott.emp where empno=5566;
     EMPNO ENAME      JOB       MGR HIREDATE    SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      5566 explain

Execution Plan
----------------------------------------------------------
Plan hash value: 2949544139
--------------------------------------------------------------------------------------
| Id  | Operation    | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |     |   1 |  87 |   2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| EMP    |   1 |  87 |   2   (0)| 00:00:01 |
|*  2 |   INDEX UNIQUE SCAN    | PK_EMP |   1 |     |   1   (0)| 00:00:01 |
--------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access("EMPNO"=5566)

set autotrace on statistics
autotrace報告sql執行統計信息(SQL  statement execution statistics. )
SQL> set autotrace on statistics;
SQL> insert into scott.emp values('6677','statistics','','','','','','');

1 row created.
—說明執行了sql
—只展示sql執行的統計信息
Statistics
----------------------------------------------------------
52  recursive calls
 5  db block gets
80  consistent gets
 0  physical reads
520  redo size
839  bytes sent via SQL*Net to client
826  bytes received via SQL*Net from client
 3  SQL*Net roundtrips to/from client
10  sorts (memory)
 0  sorts (disk)
 1  rows processed

SQL> select * from scott.emp where empno=6677;
     EMPNO ENAME      JOB       MGR HIREDATE    SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      6677 statistics

Statistics
----------------------------------------------------------
 1  recursive calls
 0  db block gets
 2  consistent gets
 0  physical reads
 0  redo size
869  bytes sent via SQL*Net to client
512  bytes received via SQL*Net from client
 1  SQL*Net roundtrips to/from client
 0  sorts (memory)
 0  sorts (disk)
 1  rows processed
set autotrace on
autotrace報告包含了最優執行方式和sql執行統計信息
SQL> set autotrace on;
SQL> insert into scott.emp  values('8899','on','','','','','','');

1 row created.

—相當于set autotrace on explain和set autotrace on statistics的和,既輸出執行計劃,也輸出統計信息,同時也執行sql
Execution Plan
----------------------------------------------------------

---------------------------------------------------------------------------------
| Id  | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------
|   0 | INSERT STATEMENT | |     1 |   100 |     1   (0)| 00:00:01 |
|   1 |  LOAD TABLE CONVENTIONAL | EMP | | |     | |
---------------------------------------------------------------------------------

Statistics
----------------------------------------------------------
45  recursive calls
 5  db block gets
77  consistent gets
 0  physical reads
512  redo size
839  bytes sent via SQL*Net to client
816  bytes received via SQL*Net from client
 3  SQL*Net roundtrips to/from client
10  sorts (memory)
 0  sorts (disk)
 1  rows processed

SQL> select * from scott.emp where empno=8899;
     EMPNO ENAME      JOB       MGR HIREDATE    SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      8899 on

Execution Plan
----------------------------------------------------------
Plan hash value: 2949544139
--------------------------------------------------------------------------------------
| Id  | Operation    | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |     |   1 |  87 |   2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| EMP    |   1 |  87 |   2   (0)| 00:00:01 |
|*  2 |   INDEX UNIQUE SCAN    | PK_EMP |   1 |     |   1   (0)| 00:00:01 |
--------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access("EMPNO"=8899)
Statistics
----------------------------------------------------------
 9  recursive calls
 0  db block gets
18  consistent gets
 0  physical reads
 0  redo size
861  bytes sent via SQL*Net to client
512  bytes received via SQL*Net from client
 1  SQL*Net roundtrips to/from client
 0  sorts (memory)
 0  sorts (disk)
 1  rows processed
set autotrace traceonly
和set autotrace on類似,但是不輸出用戶查詢的結果
SQL> set autotrace traceonly;
SQL> insert into scott.emp values('9900','traceonly','','','','','','');
1 row created.
—與set autotrace on 類似,都會輸出執行計劃和統計信息
Execution Plan
----------------------------------------------------------
---------------------------------------------------------------------------------
| Id  | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------
|   0 | INSERT STATEMENT | |     1 |   100 |     1   (0)| 00:00:01 |
|   1 |  LOAD TABLE CONVENTIONAL | EMP | | |     | |
---------------------------------------------------------------------------------

Statistics
----------------------------------------------------------
108  recursive calls
 5  db block gets
191  consistent gets
 1  physical reads
520  redo size
839  bytes sent via SQL*Net to client
825  bytes received via SQL*Net from client
 3  SQL*Net roundtrips to/from client
15  sorts (memory)
 0  sorts (disk)
 1  rows processed

SQL> select * from scott.emp where empno=9900;
—與set autotrace on不同的是,沒有輸出查詢結果
Execution Plan
----------------------------------------------------------
Plan hash value: 2949544139
--------------------------------------------------------------------------------------
| Id  | Operation    | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |     |   1 |  87 |   2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| EMP    |   1 |  87 |   2   (0)| 00:00:01 |
|*  2 |   INDEX UNIQUE SCAN    | PK_EMP |   1 |     |   1   (0)| 00:00:01 |
--------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------
   2 - access("EMPNO"=9900)
Statistics
----------------------------------------------------------
 9  recursive calls
 0  db block gets
18  consistent gets
 0  physical reads
 0  redo size
867  bytes sent via SQL*Net to client
512  bytes received via SQL*Net from client
 1  SQL*Net roundtrips to/from client
 0  sorts (memory)
 0  sorts (disk)
 1  rows processed

SQL> 


向AI問一下細節

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

AI

台东市| 会东县| 大悟县| 泰来县| 龙里县| 治多县| 富蕴县| 朝阳县| 藁城市| 房产| 长沙市| 东明县| 衡阳市| 北宁市| 台中市| 六盘水市| 格尔木市| 凤阳县| 巴塘县| 金山区| 盈江县| 永登县| 宜都市| 名山县| 上高县| 曲靖市| 阳山县| 沅陵县| 驻马店市| 鲁甸县| 锦屏县| 揭阳市| 昭平县| 宜章县| 筠连县| 巴林右旗| 彩票| 施秉县| 常德市| 凤山市| 广安市|