Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Slight "I have some string, how lng it it, BTW, it's blue" question

Re: Slight "I have some string, how lng it it, BTW, it's blue" question

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Wed, 7 Jun 2006 11:32:48 -0400
Message-ID: <PuOdneEYqcI_bBvZnZ2dnUVZ_radnZ2d@comcast.com>

"Brian Peasland" <oracle_dba_at_nospam.peasland.net> wrote in message news:J0HwM2.Lx3_at_igsrsparc2.er.usgs.gov...
: Basically, the rule of thumb I use is if it can be done with SQL
: statements, do it in SQL. If not, then use PL/SQL.
:
: If you use a view and query from the view, you are using a SQL solution.
: Using cursors to do your join will usually be slower than doing it with
: a well-formed SQL statement.

can you expand on what you mean by 'Using cursors to do your join'? are you really indicating using more than one SQL statement and somehow performing the join programmatically? after all a 'join' is by definition down within a SQL statement which is run within a cursor -- so what am i missing here?

:
: Cursors are not the fastest mechanism if you are using PL/SQL. Array
: processing is much faster. Daniel Morgan has posted some examples here:
:
: http://www.psoug.org/reference/bulk_collect.html
:

IIRC correctly from a Tom Kyte presentation, cursors (perhaps just for loop implicit cursors) in later versions of Oracle are automatcially optimized to due array fetches under the covers -- so the principle is pretty much the same (assuming multiple rows are returned) but the way to get there may differ a bit per Oracle version

++ mcs Received on Wed Jun 07 2006 - 10:32:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US