Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: cursor result return
Cris Carampa wrote:
> DA Morgan wrote:
>
>> Sybrand may well be correct about the difference ... but 9 seconds is >> unbelievably slow.
Unbelievably slow.
SQL*Plus: Release 10.1.0.3.0 - Production on Tue Feb 22 11:15:30 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> desc zip_city
Name Null? Type ----------------------------------------- -------- ------------ ZIP_CODE NOT NULL VARCHAR2(5) STATE_ABBREV NOT NULL VARCHAR2(2) CITY NOT NULL VARCHAR2(30) LAST_CHANGE_BY VARCHAR2(30) LAST_CHANGE_DT DATE
SQL> SELECT COUNT(*)
2 FROM zip_city;
COUNT(*)
3887
SQL> set timing on
SQL> DECLARE
2 TYPE myarray IS TABLE OF zip_city%ROWTYPE;
3 l_data myarray;
4
5 CURSOR c IS
6 SELECT *
7 FROM zip_city;
8 BEGIN
9 OPEN c;
10 LOOP
11 FETCH c BULK COLLECT INTO l_data LIMIT 100; 12 EXIT WHEN c%NOTFOUND;
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01
SQL>
Of course I cheated as I did this on my single CPU IBM ThinkPad running
Windows XP Pro as opposed to a production system. ;-)
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Tue Feb 22 2005 - 13:20:01 CST