benchmarking, which statement is faster
Date: 24 Jul 2001 12:39:55 -0700
Message-ID: <44ff9953.0107241139.496f2ddf_at_posting.google.com>
hi all,
has anybody benchmarked or has any idea which of the
following statements will execute faster?
my_record my_cursor%rowtype;
OPEN my_cursor;
...
...
...
fieldn)
SELECT source_field1,
source_field2,
source_field3,
...
...
...
source_fieldn)
FROM TABLE_Z, TABLE_A
WHERE xx = yy
AND zz = aa;
LOOP
FETCH my_cursor INTO my_record;
EXIT WHEN my_cursor%NOTFOUND;
INSERT INTO TABLE_X (field1,
field2,
field3,
VALUES ( my_cursor.source_field1,
my_cursor.source_field2,
my_cursor.source_field3,
...
...
...
fieldn)
...
...
my_cursor.source_fieldn);
END LOOP; CLOSE my_cursor;
Note:
- The select statements are the same.
- source_field[1..n] can be a simple field from a table or the value returned by the invocation of a database function.
thanks. Received on Tue Jul 24 2001 - 21:39:55 CEST