Re: Performance with Cursors

From: Ashish Mittal <mittalashish_at_yahoo.com>
Date: Tue, 05 Mar 2002 15:49:03 GMT
Message-ID: <PN5h8.17758$e07.3826_at_sccrnsc01>


In general though - yes performance of a cursor is slower. In essence - by using a cursor, you take away the ability of the optimizer do find the optimal puery plan. For example - take this query

select * from a,b where a.x=b.x

as opposed to

Cursor c1 is select * from a
select * from b where b.x=c1.x

The first query leaves the plan to the optimizer (which can do a hash or a merge if it likes). In the second case, you have effectively forced a nested loop join.
"Ioannis Xanthopoulos" <ixanos_at_hotmail.com> wrote in message news:1b86ec57.0203040934.43913a64_at_posting.google.com...
> I am afraid your question is too general.
> You need to refer to parts of your code and how you use the cursor you
 defined.
>
>
> graypoopawn_at_hotmail.com (Larry) wrote in message
 news:<ec40136c.0203011037.6f1aaefb_at_posting.google.com>...
> > Has anyone ever had a sever performance degrade as a result of cursors
> > being used instead of a huge sql statement? Currently, I am using a
> > cursor and then fetching 3 other values by using select into
> > statements and performance is very slow...
> >
> > Thanks.
Received on Tue Mar 05 2002 - 16:49:03 CET

Original text of this message