0

Oracle の plan_table を理解しようとしており、いくつかの SQL ステートメントを実行して plan_table に入力しました... plan_table で生成されたステートメントから、ステートメントが実行される順序を特定するにはどうすればよいですか。

ここに画像の説明を入力

4

1 に答える 1

5

から直接選択することは、PLAN_TABLEやや「非推奨」です。少なくとも今日では絶対に不要です。を使用dbms_xplanして、Explained ステートメントの実行計画を表示できます。

explain plan for
select *
from your_table;;

select * 
from table(dbms_xplan.display);

マニュアルの詳細: http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_xplan.htm#CACICEDJ

マニュアルには、コンテンツを直接SELECT取得するための(階層的な) ステートメントの例も含まれています。PLAN_TABLE

SELECT id, LPAD(' ',2*(LEVEL-1))||operation operation, options,
   object_name, object_alias, qblock_name, position 
FROM plan_table 
START WITH id = 0 AND statement_id = 'xxxxx'
CONNECT BY PRIOR id = parent_id AND statement_id = 'xxxxx'
ORDER BY id;

上記はhttp://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_9010.htm#sthref5965からの抜粋です。

'xxxx'使用している statement_idに置き換える必要があります (ステートメントに aset statement_idが必要ですexplain plan) 。

于 2013-09-22T17:05:57.697 に答える