최적화 기본값은 2 입니다.
- This enables procedure inlining, which is an optimization process that replaces procedure calls with a copy of the body of the procedure to be called.
- 최적화 기본값 확인
col name for a30
col value for a10
SELECT name, value
FROM v$parameter
WHERE name ='plsql_optimize_level' ;
--------------------------------------------
NAME VALUE
------------------------------ ----------
plsql_optimize_level 2
- 최적화 값이 0 인 경우, 실행 시간 측정
alter session set PLSQL_OPTIMIZE_LEVEL = 0;
SELECT name, value
FROM v$parameter
WHERE name ='plsql_optimize_level' ;
--------------------------------------------
NAME VALUE
------------------------------ ----------
plsql_optimize_level 0
DECLARE
A NUMBER;
B NUMBER;
C NUMBER;
BEGIN
DBMS_OUTPUT.PUT_LINE(to_char(sysdate,'hh:mi:ss'));
FOR I IN 1..100000000
LOOP
A := 1;
B := 1;
C := A+1;
END LOOP;
DBMS_OUTPUT.PUT_LINE(to_char(sysdate,'hh:mi:ss'));
END;
----------------
11:18:37
11:18:45
- 최적화 값이 2 인 경우, 실행 시간 측정
alter session set PLSQL_OPTIMIZE_LEVEL = 2;
SELECT name, value
FROM v$parameter
WHERE name ='plsql_optimize_level' ;
--------------------------------------------
NAME VALUE
------------------------------ ----------
plsql_optimize_level 2
DECLARE
A NUMBER;
B NUMBER;
C NUMBER;
BEGIN
DBMS_OUTPUT.PUT_LINE(to_char(sysdate,'hh:mi:ss'));
FOR I IN 1..100000000
LOOP
A := 1;
B := 1;
C := A+1;
END LOOP;
DBMS_OUTPUT.PUT_LINE(to_char(sysdate,'hh:mi:ss'));
END;
--------------
11:20:01
11:20:01
'Database > PLSQL' 카테고리의 다른 글
100 - [Oracle PL/SQL] Compiler - package dbms_warning (0) | 2024.05.12 |
---|---|
099 - [Oracle PL/SQL] Compiler - Warnings (0) | 2024.05.12 |
097 - [Oracle PL/SQL] Compiler - plsql_code_type (0) | 2024.05.10 |
096 - [Oracle PL/SQL] Compiler - Introduction (0) | 2024.05.09 |
095 - [Oracle PL/SQL] Triggers - 프로시져 호출 방법 및 주의 사항 (0) | 2024.05.08 |