Is nonlinear recursion allowed? Does it leverage index?

From: Mikito Harakiri <mikharakiri_at_iahu.com>
Date: Tue, 24 Feb 2004 17:24:28 -0800
Message-ID: <cYS_b.38$kg3.28_at_news.oracle.com>



I wonder if

WITH RECURSIVE MaryAncestor(anc,desc) AS

         ( (SELECT parent as anc, child as desc FROM ParentOf WHERE desc = "Mary")

           UNION
           (SELECT A1.anc, A2.desc
            FROM MaryAncestor A1, MaryAncestor A2
            WHERE A1.desc = A2.anc) )

 SELECT anc FROM MaryAncestor

is allowed in DB2 in the first place. If allowed, can it leverage join index when navigating path from "Mary" node to ancestor root? Received on Wed Feb 25 2004 - 02:24:28 CET

Original text of this message