X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id EA7BFD1D1CD for ; Fri, 9 Apr 2004 13:35:46 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 58520-05 for ; Fri, 9 Apr 2004 13:35:45 -0300 (ADT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 4EEDCD1CC78 for ; Fri, 9 Apr 2004 13:35:44 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i39GZiZl026576; Fri, 9 Apr 2004 12:35:44 -0400 (EDT) To: James Robinson Cc: pgsql-sql@postgresql.org Subject: Re: Utility of recursive queries? In-reply-to: References: Comments: In-reply-to James Robinson message dated "Fri, 09 Apr 2004 10:33:57 -0400" Date: Fri, 09 Apr 2004 12:35:44 -0400 Message-ID: <26575.1081528544@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/75 X-Sequence-Number: 17450 James Robinson writes: > Given a reference to id=3, would a recursive query be the trick to > unrolling the list to discover id=1 as the head using a SQL one-liner? I think you could do it, but don't have the syntax in my head. > would any potential recursive query implementation be > noticably more efficient that a straightforward implementation in > plpgsql Most likely not ... regards, tom lane