2016년 5월 25일 수요일

[Tuning] Explain Plan을 이용한 SQL Profile 설정

explain plan for
select user_name from fnd_user where user_name = 'KALIT';
select * from table(dbms_xplan.display(null, null, 'advanced'));


begin
  dbms_sqltune.import_sql_profile(
    name => 'test_prof',
    sql_text =>
'select /*+ full(t1) */
  *
from t1
where c1 = 1 or c2 = 2',
    profile => sqlprof_attr('USE_CONCAT(@"SEL$1" 8)',
                            'INDEX(@"SEL$1_2" "T1"@"SEL$1_2" ("T1"."C1"))',
                            'INDEX(@"SEL$1_1" "T1"@"SEL$1" ("T1"."C2"))')
  );
end;
/

댓글 없음:

댓글 쓰기