Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: UTL_FILE Performance.
It was suggested that I rewrite the procedure using FORALL and a PL/SQL
table.
My initial attempt at this, using in fact 3 pl/sql tables and inserting every 10000 records yielded a reasonable performance improvement and is (I'm pretty sure) still 8i compatible. results below
BEGIN asql.read_asql_log('work_24.log','SCRIPTS'); END;
call count cpu elapsed disk query current
rows
------- ------ -------- ---------- ---------- ---------- ----------
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 76
Elapsed times include waiting on following events:
Event waited on Times Max. Wait TotalWaited
INSERT into asql_log(tstamp,rows_affected,description)
values
(:b1,:b2,:b3)
call count cpu elapsed disk query current
rows
------- ------ -------- ---------- ---------- ---------- ----------
however I didn't particularly like the ugly code or the 3 different
pl/sql tables (one for each column into which I was inserting). So then
I decided to abandon the IOT idea and the primary key (I will probably
add a calculated line number in as a pk at a later date), and to use the
ability to do a simple insert with a table of %ROWTYPE. The results are
below and the revised script is at
http://www.niall.litchfield.dial.pipex.com/scripts/tests/read_asql_faste
r.sql
BEGIN ASQL.READ_ASQL_LOG('work_24.log','SCRIPTS'); END;
call count cpu elapsed disk query current
rows
------- ------ -------- ---------- ---------- ---------- ----------
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 76
Elapsed times include waiting on following events:
Event waited on Times Max. Wait TotalWaited
INSERT into asql_log
VALUES
(:b1,:b2,:b3)
call count cpu elapsed disk query current
rows
------- ------ -------- ---------- ---------- ---------- ----------
Misses in library cache during parse: 0
Misses in library cache during execute: 1
Optimizer goal: CHOOSE
Parsing user id: 76 (recursive depth: 1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait TotalWaited
COMMIT
call count cpu elapsed disk query current
rows
------- ------ -------- ---------- ---------- ---------- ----------
Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 76 (recursive depth: 1)
INSERT into asql_log
values
(:b1,:b2,:b3)
call count cpu elapsed disk query current
rows
------- ------ -------- ---------- ---------- ---------- ----------
Sorry if this is teaching you all to suck eggs, but it maybe that the lessons I learned might help someone else someday. Cheers to Connor et al for helping me out along the way.
Niall Litchfield
Oracle DBA
Audit Commission
+44 117 975 7805
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.htmlReceived on Thu Feb 19 2004 - 10:09:35 CST
-----------------------------------------------------------------
![]() |
![]() |