Re: Does Oracle encourage developers to use cursors?

From: Robert Klemme <shortcutter_at_googlemail.com>
Date: Sat, 27 Oct 2012 10:54:39 +0200
Message-ID: <af1lqiFq41dU1_at_mid.individual.net>



On 24.10.2012 12:50, Jonathan Lewis wrote:
> If you want a useful answer to this question you probably ought to start
> from the assumption that the people you're talking to have no idea how SQL
> Server handles cursors (or what the term even means in SQL Server) and why
> they are considered slow. So tell us about cursors in SQL Server and we can
> tell you about the things that look different in Oracle.
>
> It may come down to something as simple as "cursors imply row by row
> processing, which tends to be much slower than set-wise processing with
> simple SQL" - that's a statement that is essentially true in either
> environment. On the other hand you may have some completely different
> comparison in mind when you pose your question.

Or it could even boil down to the advice to mostly restrict cursor use to stored procedures and functions and not use them from a client application to avoid the overhead of relatively slow network communication _per row_. (Although I believe some drivers nowadays do some optimization with client side caching etc.)

Kind regards

        robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
Received on Sat Oct 27 2012 - 10:54:39 CEST

Original text of this message