Hi all,

Here's an updated version of the experimental qCache patch I
posted a couple days ago (which is a port of Karel Zak's 7.0
work to CVS HEAD).

Changes:

- fix segfault in EXECUTE under some circumstances (reported
  by Barry Lind)
- fix some memory leaks  (thanks to Karel Zak)
- write more regression tests (make check still won't pass)
- re-diff against CVS HEAD
- more code cleanup, minor tweaks

However, I've tentatively decided that I think the best
way to go forward is to rewrite this code. IMHO the utility of
plans cached in shared memory is fairly limited, but the
code that implements this adds a lot of complex to the patch.
I'm planning to re-implement PREPARE/EXECUTE with support only
for locally-prepared plans, using the existing patch as a
guide. The result should be a simpler patch -- once it's
in CVS we can worry about more advanced plan caching
techiques. Any complaints/comments on this plan?

Cheers,

Neil

-- 
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC
Wed, 17 Apr 2002 17:17:51 -0400
Neil Conway <nconway@klamath.dyndns.org>
updated qCache
Neil Conway <nconway@klamath.dyndns.org> writes:
> I'm planning to re-implement PREPARE/EXECUTE with support only
> for locally-prepared plans, using the existing patch as a
> guide. The result should be a simpler patch -- once it's
> in CVS we can worry about more advanced plan caching
> techiques. Any complaints/comments on this plan?

That's what I wanted from day one ;-)

			regards, tom lane

Thu, 18 Apr 2002 00:06:06 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: updated qCache 
> Neil Conway <nconway@klamath.dyndns.org> writes:
> > I'm planning to re-implement PREPARE/EXECUTE with support only
> > for locally-prepared plans, using the existing patch as a
> > guide. The result should be a simpler patch -- once it's
> > in CVS we can worry about more advanced plan caching
> > techiques. Any complaints/comments on this plan?
>
> That's what I wanted from day one ;-)

So with this scheme, people just have to be careful to use a connection pool
/ persistent connections?

Chris


Thu, 18 Apr 2002 12:15:53 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: updated qCache 
> Neil Conway <nconway@klamath.dyndns.org> writes:
> > I'm planning to re-implement PREPARE/EXECUTE with support only
> > for locally-prepared plans, using the existing patch as a
> > guide. The result should be a simpler patch -- once it's
> > in CVS we can worry about more advanced plan caching
> > techiques. Any complaints/comments on this plan?
>
> That's what I wanted from day one ;-)

You know, if we had a threaded backend, we wouldn't have any of these
problems :)

Chris


Thu, 18 Apr 2002 12:16:55 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: updated qCache 
On Wed, Apr 17, 2002 at 05:17:51PM -0400, Neil Conway wrote:
> Hi all,
> 
> Here's an updated version of the experimental qCache patch I
> posted a couple days ago (which is a port of Karel Zak's 7.0
> work to CVS HEAD).
> 
> Changes:
> 
> - fix segfault in EXECUTE under some circumstances (reported
>   by Barry Lind)
> - fix some memory leaks  (thanks to Karel Zak)
> - write more regression tests (make check still won't pass)
> - re-diff against CVS HEAD
> - more code cleanup, minor tweaks
> 
> However, I've tentatively decided that I think the best
> way to go forward is to rewrite this code. IMHO the utility of
> plans cached in shared memory is fairly limited, but the
> code that implements this adds a lot of complex to the patch.
> I'm planning to re-implement PREPARE/EXECUTE with support only
> for locally-prepared plans, using the existing patch as a
> guide. The result should be a simpler patch -- once it's
> in CVS we can worry about more advanced plan caching
> techiques. Any complaints/comments on this plan?

 I agree too :-) I think remove the shared memory code from this patch
 is easy and local memory storage is there already done.

        Karel

-- 
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

Thu, 18 Apr 2002 10:34:08 +0200
Karel Zak <zakkr@zf.jcu.cz>
Re: updated qCache
On Wed, Apr 17, 2002 at 05:17:51PM -0400, Neil Conway wrote:
> Hi all,
> 
> Here's an updated version of the experimental qCache patch I
> posted a couple days ago (which is a port of Karel Zak's 7.0
> work to CVS HEAD).

 I have a question, what the Dllist and malloc()? I think it's
 nothing nice for local-memory cache too.

 There is needful destory cached planns by one call of 
 MemoryContextDelete(). I hope that Neil wants still use 
 original "context-per-plan" cache.

      Karel

-- 
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

Thu, 18 Apr 2002 11:04:21 +0200
Karel Zak <zakkr@zf.jcu.cz>
Re: updated qCache