Re: [HACKERS] Cache query (PREPARE/EXECUTE) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Cache query (PREPARE/EXECUTE)
Date
Msg-id 24214.951239775@sss.pgh.pa.us
Whole thread Raw
In response to Cache query (PREPARE/EXECUTE)  (Karel Zak - Zakkr <zakkr@zf.jcu.cz>)
Responses Re: [HACKERS] Cache query (PREPARE/EXECUTE)  (Karel Zak - Zakkr <zakkr@zf.jcu.cz>)
RE: [HACKERS] Cache query (PREPARE/EXECUTE)  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
List pgsql-hackers
Karel Zak - Zakkr <zakkr@zf.jcu.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.

> 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.

> 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...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Karel Zak - Zakkr
Date:
Subject: Re: [HACKERS] Cache query (PREPARE/EXECUTE)
Next
From: Karel Zak - Zakkr
Date:
Subject: Re: [HACKERS] Cache query (PREPARE/EXECUTE)