Re: support for recursive queries

From: Tulio Hernandez <tulio_at_vaneyck.portal.com>
Date: Thu, 9 Sep 93 01:17:31 GMT
Message-ID: <1993Sep9.011731.2308_at_vaneyck.portal.com>


In article <CD04yA.Ips_at_news.cis.umn.edu> bzwatsch_at_bingo.ncc.umn.edu () writes:
>In dealing with querying hierarchically structured data, I found Oracle's
>extension of the select statement with the "connect by" and "start with"
>clause very convenient. Does Sybase also have constructs that support
>such recursive queries?
>
>Thanks in advance for any comments!

Strictly speaking - no. Navigating hierarchically structured data with Sybase is tricky and slow. One way is to rig a while loop and fake traversing thru the hierarchy by cycling thru each row, adding and deleting hierarchy members in a temp table, until all elements have been visited [if interested, I'll e-mail you the code]. This is slow but is faster than stringing queries recursively as each query traverses the hierarchy.

The reason both of these methods are slow is because they deal with data on a per row basis rather than on a set basis - going against the grain of the relational model.

Other databases like Teradata (I am not sure about Oracle 7) allow multiple outer-joins. With multiple outer-joins, one can write simple queries to retrieve an entire branch of a tree relatively quickly; about 500% quicker than with the above methods.

Recently, I've notice more people using Sybase to store hierarchically structured data. With this volume of people growing I reiterate my request to Sybase:

	Please, implement this multiple outer-joins facility so that us 
	hierarchically structured users can traverse our trees a little easier.





Tulio Received on Thu Sep 09 1993 - 03:17:31 CEST

Original text of this message