Re: usage for 'with recursive'?

From: Kenneth Downs <ken(at)secdat(dot)com>
To: hubert depesz lubaczewski <depesz(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: usage for 'with recursive'?
Date: 2007-03-02 12:32:17
Message-ID: 45E81951.40604@secdat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hubert depesz lubaczewski wrote:
> On 3/1/07, Kenneth Downs <ken(at)secdat(dot)com> wrote:
>> Better? I think perhaps different. There is materialized path, which
>> requires a very problematic unlimited-length column to hold the path,
>> and there is upper/lower bounds, which again requires client-side
>> row-by-row processing. Both have the unpleasant problem that changes to
>> one row may affect many others.
>
> there are also other approaches.
> i know that they are not that well known, but there are, and they
> allow many things to be done with very simple queries.
> i use a solution which basically allows me to query every kind of
> tree-structure data without loops or recursion. drawbacks are 2 and
> are very limited:
> 1. it uses some triggers
> 2. it has some (slight in my opinion) overhead.

I see you've moved the client-side code to the server, which is a Good
Thing in my book.

The overhead would be proportional to the number of rows that have to be
looked at when a new row goes in.

This reminds me of another advantage of the WITH RECURSIVE, which is
that it pushes to overhead to SELECT, with no associated write-time
overheads.

--
Kenneth Downs
Secure Data Software, Inc.
www.secdat.com / www.andromeda-project.org
Office: 631-689-7200 Cell: 631-379-0010

::Think you may have a problem with programming? Ask yourself this
::question: do you worry about how to throw away a garbage can?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-03-02 14:09:47 Re: Thanks to all
Previous Message andyk 2007-03-02 11:46:21 Re: 8.1.8 Installer Fails on Win2k Server