Re: Recursive relationship, performance problem

From: Dave Mausner <dmausner_at_brauntech.com>
Date: 1996/08/25
Message-ID: <4vpt59$qlt_at_client3.news.psi.net>#1/1


In article <4v9q36$imf_at_news00.btx.dtag.de>, SEKAS_at_t-online.de (SEKAS) wrote:
>Performance problems with hirarchical structures realized by selfrelationship
> select *
> from objects
> where object_type = <searched child object type>
> and object_id in
> (
> select object_id
> from objects
> start with object_id = <object_id of node start>
> connect by prior object_id = parent_objectid

without answering the entire post, i would just like to mention that you could avoid the subquery by realizing that PRIOR is an operator with associative properties. therefore you could write:

	select object_id
	  from objects
	  start with object_id = o1.object_id
	  connect by prior (object_id = parent_objectid 
	  and object_type = <searched child object type>)

--
Dave Mausner, Consulting Manager, Braun Technology Group, Chicago.
Received on Sun Aug 25 1996 - 00:00:00 CEST

Original text of this message