Path: news.f.de.plusline.net!news-fra1.dfn.de!newsfeed.hanau.net!newsfeed01.sul.t-online.de!t-online.de!solnet.ch!solnet.ch!newspeer1.nwr.nac.net!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny01.POSTED!3abab865!not-for-mail
From: "David Cressey" <cressey73@verizon.net>
Newsgroups: comp.databases.theory
References: <ZE%_h.163$D52.68@trndny04> <YR0%h.16775$YL5.84@newssvr29.news.prodigy.net>
Subject: Re: Self Joins and optimization
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
Message-ID: <CJ2%h.2599$XZ2.50@trndny01>
Date: Sat, 05 May 2007 16:59:14 GMT
NNTP-Posting-Host: 72.70.235.201
X-Complaints-To: abuse@verizon.net
X-Trace: trndny01 1178384354 72.70.235.201 (Sat, 05 May 2007 12:59:14 EDT)
NNTP-Posting-Date: Sat, 05 May 2007 12:59:14 EDT
Xref: news.f.de.plusline.net comp.databases.theory:43793


"Brian Selzer" <brian@selzer-software.com> wrote in message
news:YR0%h.16775$YL5.84@newssvr29.news.prodigy.net...
>
> "David Cressey" <cressey73@verizon.net> wrote in message
> news:ZE%_h.163$D52.68@trndny04...
>
> I'm putting my response to post in the other thread here, since it appears
a
> more appropriate place.
>
> "David Cressey" <cressey73@verizon.net> wrote in message
> news:dL__h.1686$XZ2.1572@trndny01...
> >
> [snip]
> > And yet, someone else in this newgroup (not me) reported that he took a
> > batch job that was taking 45 hours using legacy code,  rewrote it using
> > about 300 lines of SQL,  and got something to run in about 45 minutes.
Do
> > you think he was lying?  Do you think he was using cursors?
> >
>
> No.  I certainly don't think he was lying.  I've experienced similar
> results.  Used poorly, cursors can change big-O from O(n) to O(n^2).  An
> extra database access within the fetch loop causes the iterative solution
to
> operate similar to a loop join optimizer step.  There is no question that
a
> cursor that hits the database several times within the fetch loop will
> perform abysmally for large n.
>
> >
> > I also have a long history of personal experience to draw on, including
> > optimizer workarounds.  But I am not as dismissive of what others report
> > as
> > you are.  Cimode is offering as close to "hard evidence"  as anything
that
> > can be squeezed through the narrow pipeline of a newgroup.  And yet
you've
> > dismissed his conclusion out of hand,  without really putting it to the
> > test.
> >
>
> I didn't dismiss his conclusion altogether, but I think his example
supports
> an argument against a poor use of a cursor, not every possible use.
>

But his point was about interpolation,  not about cursors,  right?
> [snip]
>
>


