strategies for optimising common lookups etc

From: Martin Hart <martin(at)zsdfherg(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: strategies for optimising common lookups etc
Date: 2003-08-08 13:19:37
Message-ID: 200308081419.37723.martin@zsdfherg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi all, apologies if this is a dumb question - not really sure where to look
for this kind of stuff...

I have a frequently called stored procedure that needs to access some
"configuration" information to determine how it should behave.

Currently I have the configuration information in its own table, and the sp
does a lookup "select item from config where pk = ...".

I am wondering whether there is any way to "cache" the result of a lookup
across instances of the stored procedure call? The configuration value will
rarely change, and as the procedure is called often it seems a bit of a waste
of resources looking it up each time the procedure is run.

Is this the sort of thing that internal variables would handle (by that I mean
using "set" and "show")?

TIA
Martin

--
Martin Hart
Arnclan Limited
53 Union Street
Dunstable, Beds
LU6 1EX
http://www.arnclanit.com

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Bartlett 2003-08-08 13:27:45 Re: XML?
Previous Message Chris Webster 2003-08-08 12:58:47 Re: postmaster(s) have high load average