Re: Query caching - Mailing list pgsql-hackers

From Karel Zak
Subject Re: Query caching
Date
Msg-id Pine.LNX.3.96.1001112121835.30482B-100000@ara.zf.jcu.cz
Whole thread Raw
In response to Re: Query caching  (devik@cdi.cz)
List pgsql-hackers
On Fri, 10 Nov 2000 devik@cdi.cz wrote:

> Did someone think about query costs ? Is you prepare
> query like SELECT id FROM t1 WHERE type=$1 and
> execute it with $1=1 and 2. For 1 there is one record
> in t1 a all other have type=2.
> Without caching, first query will use index, second
> not.
> Should cached plan use index or not ?
> devik
The postgresql already have planns caching. See SPI (saveplan), but
it's usable for internal stuff (for example triggers..) only. The
PREPARE/EXECUTE pull up it to be<->fe and make new memory type that
allows save it in shared memory. But else it's *nothing* new. 
A validity of cached planns is user problem now. Not some internal
method how check changes that out of date some query (or exist some idea?). 
It can be more changes like changes in DB schema.
If resolve this anyone clever person it will great for VIEW, SPI too.
Rebuid a query plan in the planner is not a problem, in the cache is 
stored original query tree, but you must known when... or must know
it a DB user.
                Karel



pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: [RELEASE ANNOUNCEMENT] v7.0.3 *Final* now Available
Next
From: Larry Rosenman
Date:
Subject: SYSLOG/LOG_LOCAL0