Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Is nonlinear recursion allowed? Does it leverage index?
"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)
would produce
sg(X,Y)
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
![]() |
![]() |