Re: Is there any way to index or cache a view, or function results?

From: "Jason Long" <jason(at)supernovasoftware(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there any way to index or cache a view, or function results?
Date: 2006-07-01 21:36:31
Message-ID: 27248561.1151789740918.JavaMail.SYSTEM@server00-a4kpy5
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was hoping for something a bit more automatic with less maintenance from
me. Thank you for your reply.

Thank you for your time,

Jason Long
CEO and Chief Software Engineer
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com
HJBUG Founder and President
http://www.hjbug.com

-----Original Message-----
From: Tomi NA [mailto:hefest(at)gmail(dot)com]
Sent: Saturday, July 01, 2006 4:17 PM
To: jason(at)supernovasoftware(dot)com
Subject: Re: [GENERAL] Is there any way to index or cache a view, or
function results?

On 7/1/06, Jason Long <jason(at)supernovasoftware(dot)com> wrote:
>
> Is it possible to define a function or view that performs fairly intensive
> calculations and then index or cache these results?
>
> The data I have will be accessed more than modified, but still will be
> modified semi regularly.
>
> Would someone please enlighten me on my options for improving performance
is
> this situation?

You could create a new table to store the results in and refresh it's
contents every time the original data changes and you can index
whatever you want, as long as you take into account that frequent and
extensive changes to a table with a couple of indexes might slow
things down a bit, depending on the number of changed records, the
number of indices you define on the table and so on...
You can keep the data in sync using triggers or with a periodic update
task, depending on what kind of precision you need.

Cheers,
t.n.a.

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.8/380 - Release Date: 6/30/2006

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.8/380 - Release Date: 6/30/2006

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Clodoaldo Pinto 2006-07-01 21:47:28 Re: Postgresql does not start on reboot
Previous Message a 2006-07-01 20:32:59 Re: db question - dynamic fields in db