Re: Cached Query Plans (was: global prepared statements) - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Cached Query Plans (was: global prepared statements)
Date
Msg-id 20080413150907.GB32735@svana.org
Whole thread Raw
In response to Re: Cached Query Plans (was: global prepared statements)  (PFC <lists@peufeu.com>)
List pgsql-hackers
On Sun, Apr 13, 2008 at 02:26:04PM +0200, PFC wrote:
> * global plan cache in shared memory, implemented as hashtable, hash key
> being the (search_path, query_string)
> Doubt : Can a plan be stored in shared memory ? Will it have to be copied
> to local memory before being executed ?

Frankly, I think you're better off storing them in a table. Shared
memory is a limited resource and you cannot change how much you've
allocated after the server has started. It does mean you'll have to
serialise/deserialise them, but this will be cheaper than replanning,
right?

I liked your global prepared statements idea much better. Named the
statements is no problem: DB frontends do that for you anyway
sometimes.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: Kris Jurka
Date:
Subject: Re: [Pljava-dev] stack depth limit exceeded - patch possible?
Next
From: "Dawid Kuroczko"
Date:
Subject: Re: Cached Query Plans (was: global prepared statements)