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: Andrew <andrewgothard_at_Nospamthanks.com>
Date: Thu, 08 Jun 2006 22:39:27 GMT
Message-ID: <zG1ig.5059$1Z2.3116@newsfe7-win.ntli.net>

"Brian Peasland" <oracle_dba_at_nospam.peasland.net> wrote in message news:J0JMxt.8E7_at_igsrsparc2.er.usgs.gov...
> Andrew wrote:
> > "Brian Peasland" <oracle_dba_at_nospam.peasland.net> wrote in message
> > news:J0HyE7.xG_at_igsrsparc2.er.usgs.gov...
> >>> : 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?
> >> You'd have to ask the OP. It was he who said "Sorry it this isn't clear
> >> - the reasoning behind
> >> some of the use of cursors to mimic joins is way beyond me." I'm
> >> assuming that he is processing
> >> the join programmatically, but that is just an assumption.
> >>
> >> Cheers,
> >> Brian
> >>
> > Well - it's a trivial join n most respects. I'm now a grunt - but used
to
> > call the shots as far as standards went. One stamdard was - "Use a
cursor
> > when you can avoid it, kiss your arse goodbye"
> > To put the point bluntly - I'm baffled by the concept that rather than
use a
> > well structured set of views - you basically write COBOL in PL/SQL

>

> As well you should be. As I stated before....if you can do it in SQL,
> choose that approach over PL/SQL. Most every time, SQL will beat PL/SQL.
> I cannot think of an exception to this rule, but I'm leaving open the
> possibility that someone will come up with that exception.
Well - I've done ir before in SQLServer - for complex satistical analysis - but that was inthe days it didnt have functions - I'd use them rather than cursors now

>
> > OK - if you get paid, you do what you're told - but #i consider it to be
a
> > personal affront - and would like ammo to try and change it. Hell - our
> > hardware supplier must be making a fortune we should not be paying on
the
> > back of this approach.
> > Even more than SQLServer on NT - I'd expect huge gains with cunning ( or
> > totally bleeding obvious) use of the parallism you can get by splitting
> > queries over several views. Seems a no brainer to me - but apparently
I'm
> > wrong.
> >

>

> Oracle will merge views by default. So if you have a view call a view,
> and your write SQL to reference the first view, Oracle will merge all
> the views into your SQL statement and then execute the entire thing as
> one large SQL statement.

>
> HTH,

It does - cheers Brian. Optimiser in SQLServer wil split it into parallel queries.
Mind - I gt the feling that yu have enough knowledge to kill me on the spot here - but I thought Oracle did the same thing. The 8.xxx documentation certainly suggests it does, but having said that I tend towards experience over documentation every time. I've seen some total shite in docs in my time. Received on Thu Jun 08 2006 - 17:39:27 CDT

Original text of this message

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