Re: Immutable table functions

From: Yeb Havinga <yebhavinga(at)gmail(dot)com>
To: Luiz Angelo Daros de Luca <luizluca(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Immutable table functions
Date: 2010-02-12 13:31:22
Message-ID: 4B75582A.9090100@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Luiz Angelo Daros de Luca wrote:
>
> I have a directed graph, or better, a tree in postgresql 8.3. One
> table are the nodes and another one are the connections. Given any
> node, I need to get all nodes down to it(to the leafs) that have
> relation with anotherTable. Also, this connection change on time, so I
> have a connectionDate and a disconnectionDate for each connection
> (which might be null to represent open interval). This way, I wrote a
> pgsql function (I rename the tables and columns to generic names).
> These are the tables and the function:
>
Hello Luiz,

If you could upgrade to 8.4, you could use WITH RECURSIVE - my
experience is that it is several orders of magnitude faster than
recursive functions.

http://developer.postgresql.org/pgdocs/postgres/queries-with.html

regards,
Yeb Havinga

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message lionel duboeuf 2010-02-12 13:35:15 Almost infinite query -> Different Query Plan when changing where clause value
Previous Message Kevin Grittner 2010-02-12 13:21:55 Re: moving pg_xlog -- yeah, it's worth it!