|
|
Question : access time and use_hash(Oracle PL/SQL)
|
|
Suppose I have a procedure with main for loop of hash_join as follows, but my rowsource is of minimum of 8,000 rows with 12 selected columns. Here the time takes from level0 to levelstart = 3 minutes. level1 to level2 takes < 1 second. level2 to level1 takes 3 seconds. level2 to level3 takes < 1 second. level3 to level1 takes 3 seconds.
Can you please explain why it's takes 3 seconds to read from the main loop a_v each time ?
Procedure abc is begin <> for a_v in (SELECT /*+use_hash(e d)*/ d.deptno,e.empno,e.ename,d.dname FROM emp e, dept d WHERE e.deptno = d.deptno and d.ename like 'AB%') <> loop <> IF a_v.deptno = 10 then loop .. .. end loop; end if; <> if a_v.deptno = 20 then loop .. .. end loop; end if; <> if a_v.deptno = 30 then loop .. .. end loop; end if; end loop; end abc;
|
Answer : access time and use_hash(Oracle PL/SQL)
|
|
This has to do with your network traffic. Here is how you could test this.. You need to have plustrace role granted, and access to plan table..to do this..
SQL> set autotrace on SQL> run the query.. See the number of SQL *Net trips from Client to Server, and back..this would give a feeling of how much time its taking to get the data..
Now increase the sql array size in the sql prompt.. and run the query again.. Now your roundtrip size and time will reduce
|
|
|
|
|