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: Is nonlinear recursion allowed? Does it leverage index?

Re: Is nonlinear recursion allowed? Does it leverage index?

From: Mikito Harakiri <mikharakiri_at_iahu.com>
Date: Wed, 25 Feb 2004 11:50:05 -0800
Message-ID: <J87%b.23$OB.162@news.oracle.com>


"Serge Rielau" <srielau_at_ca.eye-be-em.com> wrote in message news:c1innt$hgv$1_at_hanover.torolab.ibm.com...
> Mikito Harakiri wrote:
> >
> > BTW, I'm comparing "connect by" and "recursive with". Is there a query
that
> > can be expressed in the one and cannot in the other?
> >
> Good question. I remember a thread in the Oracle newsgroup that
> concluded that the standard version was more powerful, but that was
> hardly based on a mathematical proof.
> Also note that O10g has made changes to connect by.
>
> There is one thing I can say with confidence:
> Rewriting one as the other is in general non trivial.
>
> Things are getting interesting when you try to tease order and level
> information out of "recursive with".
> Given that I never wrote anything using connect by I can't comment where
> connect by stumbles.

How about "same generation"?

sg(X,X) <- person(X)
sg(X,Y) <- parent(X,Z), sg(Z,W), parent(Y,W)

For example

parent(X,Y)



1 3
1 3
3 4
2 5
4 5

would produce

sg(X,Y)



1 1
2 2
3 3
4 4
5 5
2 3
4 5

There is no difficulty translating this Datalog into "recursive with", but how do approach this problem with "connect by"? (Hint: I made the graph been non-balanced on purpose: to eliminate any futile attemplts leveraging "level"). Received on Wed Feb 25 2004 - 13:50:05 CST

Original text of this message

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