DUAL vs. FAST DUAL (_fast_dual_enabled)

Wednesday, 17.10.2007 – Dejan

Ukoliko u izvornom k├┤du ─Źesto koristite DUAL tabelu, npr.┬á “SELECT sysdate FROM dual”, interne funkcije USER, USERENV, SYS_CONTEXT ili pseudokolone (ROWID, LEVEL i td.), onda pogledajte, da li je pode┼íen parametar “_fast_dual_enabled” i da li je postavljen na “true”, jer u verziji 10g Oracle koristi pobolj┼íani “access path” za operacije, koje uklju─Źuju DUAL tabelu i za svaku tu operaciju ┼ítedi 3 logi─Źka I/O upita.

Dokaz:

SQL> select sysdate from dual;

Execution Plan 
--------------------------------------------------------- 

0    SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1) 
1  0  FAST DUAL (Cost=2 Card=1) 

Statistics 

--------------------------------------------------------- 
0 consistent gets 

SQL> alter session set "_fast_dual_enabled"=false; 

SQL> select sysdate from dual; 

Execution Plan 

---------------------------------------------------------

0    SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1)

1  0  TABLE ACCESS (FULL) OF 'DUAL' (TABLE) (Cost=2 Card=1) 

Statistics 

----------------------------------------------------------

3 consistent gets

Postavite taj parametar na TRUE i u┼żivajte.

Post a Comment