Re: Need help on limiting # of rows returned...
Date: 17 Feb 1994 22:21:28 GMT
Message-ID: <2k0ql8$2vd_at_anaxagoras.ils.nwu.edu>
In article <1994Feb16.170313.3609_at_greenwich.com> Peter Sterne,
pete_at_greenwich.com writes:
>My understanding of cursors (likely incorrect 8^) is that they retrieve
ALL
>of the rows into memory, the developer can then access the rows
individually
>as shown in the example. If so, the solution above will work, but it
might not
>really address the performance issue.
If cursors in PL/SQL work the same as those in embedded SQL then all rows are not fetched at one. However, if the ORDER BY requires a sort, then all records will have to located and sorted in order to find the minima. That is presumably the expensive part of the process. The way to avoid that sort is to have it use an index. Then using a FOR clause with the fetch, followed by a close, should solve the problem. Received on Thu Feb 17 1994 - 23:21:28 CET
