SQL性能改善めも
●オプティマイザのパラメータ確認
select * from V$SYS_OPTIMIZER_ENV;
select * from V$SES_OPTIMIZER_ENV:
select * from V$SES_OPTIMIZER_ENV:
●オプティマイザヒント確認
select * from v$sql_hint;
●各オブジェクトのSELECTIVITY確認
セレクティビティ(選択率) = 条件を適用した結果の行数 / 全体の行数 カーディナリティ = 表の行数 × セレクティビティ
select count(distinct 列名1), count(distinct 列名2), … count(distinct 列名N)
from 対象表名
from 対象表名
●plan_tableの作成
●実行計画の生成
explain plan for SQL文
●実行計画確認
●PLAN_TABLE別名
CREATE OR REPLACE PUBLIC SYNONYM my_plan_table for plan_table$
●SQL文確認
select * from v$sqltext;
●SQLによる確認
●SQL実測確認
set pages 50000
set lines 30000
set trimspool on
set timing on
set time on
set autot on
spool <スプールファイル名>
<対象SQL実行>
spool off
set lines 30000
set trimspool on
set timing on
set time on
set autot on
spool <スプールファイル名>
<対象SQL実行>
spool off
●実行中のSQL確認