Re: [HACKERS] Cache query (PREPARE/EXECUTE)

From: Karel Zak - Zakkr <zakkr(at)zf(dot)jcu(dot)cz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Cache query (PREPARE/EXECUTE)
Date: 2000-02-22 17:30:48
Message-ID: Pine.LNX.3.96.1000222182125.28804C-100000@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Tue, 22 Feb 2000, Tom Lane wrote:

> Karel Zak - Zakkr <zakkr(at)zf(dot)jcu(dot)cz> writes:
> > as I said, I tring implement PREPARE / EXECUTE command for user a
> > controllable query cache (in TODO: Cache most recent query plan(s)).
>
> Looks cool.

Thanks.

>
> > The queryTree and planTree are save in hash table and in the
> > TopMemoryContext (Is it good space for this cache?).
>
> Probably not. I'd suggest making a separate memory context for
> this purpose --- they're cheap, and that gives you more control.
> Look at the creation and use of CacheMemoryContext for an example.

Yes, I agree (TopMemoryContext was simpl for first hacking).
But I not sure how create new (across transaction persistent?)
MemoryContext. It needs new portal? (Sorry I not thoroughly explore
PG's memory management.)

>
> > I'am not sure with syntax, now is:
>
> > PREPARE name AS optimizable-statement [ USING type, ... ]
> > EXECUTE name [ USING value, ... ]
>
> > Comments? Suggestions? (SQL92?)
>
> This seems to be quite at variance with SQL92, unfortunately, so it
> might not be a good idea to use the same keywords they do...

Hmm, I inspire with Jan's TODO item. What use:

CREATE PLAN
DROP PLAN
EXECUTE PLAN

IMHO these kaywords are better.
Karel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-02-22 17:46:38 Re: [ANNOUNCE] PostgreSQL v7.0 goes Beta ...
Previous Message Tom Lane 2000-02-22 17:16:15 Re: [HACKERS] Cache query (PREPARE/EXECUTE)