Re: Storing computed values - Mailing list pgsql-general

From Richard Broersma
Subject Re: Storing computed values
Date
Msg-id 396486430804211048p38cb673dl17284ef8e11481ef@mail.gmail.com
Whole thread Raw
In response to Storing computed values  (Colin Wetherbee <cww@denterprises.org>)
Responses Re: Storing computed values  (Colin Wetherbee <cww@denterprises.org>)
List pgsql-general
On Mon, Apr 21, 2008 at 10:34 AM, Colin Wetherbee <cww@denterprises.org> wrote:

> I would like to have a table that contains a connection for each distinct
> pair of points (point1 to point2 is the same as point2 to point1).  This
> table would then be automatically updated every time a modification is made
> to the reference table.  If my calculation is correct, the new table would
> contain 3,654,456 rows using the current data set.
>
> I realize I could use a TRIGGER to keep the connections table fresh, and
> perhaps that's also a solution.
>
> But, really, I'm just wondering if PostgreSQL has some automated, built-in
> facility for situations like this?

Would a functional index do this for you?  Perhaps, you wouldn't even
need a table is you store these computed values in an index instead.


--
Regards,
Richard Broersma Jr.

pgsql-general by date:

Previous
From: Colin Wetherbee
Date:
Subject: Storing computed values
Next
From: Colin Wetherbee
Date:
Subject: Re: Storing computed values