一、描述
在查看執(zhí)行計(jì)劃測試的過程中遇到使用dbms_xplan.display無法查看執(zhí)行計(jì)劃,發(fā)現(xiàn)是因?yàn)橹霸跍y試的過程中打開了set autot on,關(guān)閉后(set autot off) ,執(zhí)行計(jì)劃可以正常顯示。
成都創(chuàng)新互聯(lián)專注于天臺(tái)網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供天臺(tái)營銷型網(wǎng)站建設(shè),天臺(tái)網(wǎng)站制作、天臺(tái)網(wǎng)頁設(shè)計(jì)、天臺(tái)網(wǎng)站官網(wǎng)定制、小程序開發(fā)服務(wù),打造天臺(tái)網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供天臺(tái)網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。
二、操作過程
SQL>
SQL> explain plan for select count(*) from tt;
Explained.
Elapsed: 00:00:00.00
SQL> set lines 200 pages 2000
SQL> select * from table(dbms_xplan.display());
9 rows selected.
Elapsed: 00:00:00.02
Execution Plan
----------------------------------------------------------
Plan hash value: 2137789089
---------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 8168 | 16336 | 29 (0)| 00:00:01 |
| 1 | COLLECTION ITERATOR PICKLER FETCH| DISPLAY | 8168 | 16336 | 29 (0)| 00:00:01 |
---------------------------------------------------------------------------------------------
Statistics
----------------------------------------------------------
14 recursive calls
12 db block gets
55 consistent gets
0 physical reads
0 redo size
1124 bytes sent via SQL*Net to client
519 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
9 rows processed
##上面無法顯示執(zhí)行計(jì)劃,很奇怪!?。?
##關(guān)閉autot ,再次查看執(zhí)行計(jì)劃OK!??!
SQL> set autot off
SQL> select * from table(dbms_xplan.display());
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3133740314
-------------------------------------------------------------------
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
-------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 21556 (1)| 00:04:19 |
| 1 | SORT AGGREGATE | | 1 | | |
| 2 | TABLE ACCESS FULL| TT | 2762K| 21556 (1)| 00:04:19 |
-------------------------------------------------------------------
9 rows selected.
Elapsed: 00:00:00.02
##解釋一下執(zhí)行計(jì)劃,首先是做了全表掃描這個(gè)很容易理解,sort aggregage 是因?yàn)樽隽薱ount(*) 聚合。
SQL>
分享題目:Oracle查看執(zhí)行計(jì)劃問題
文章位置:http://jinyejixie.com/article8/ijcsop.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、商城網(wǎng)站、營銷型網(wǎng)站建設(shè)、面包屑導(dǎo)航、Google、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)