Re: bind variables, soft vs hard parse - Mailing list pgsql-hackers

From Marcus Engene
Subject Re: bind variables, soft vs hard parse
Date
Msg-id 437AF44C.1010209@engene.se
Whole thread Raw
In response to Re: bind variables, soft vs hard parse  (Douglas McNaught <doug@mcnaught.org>)
Responses Re: bind variables, soft vs hard parse
List pgsql-hackers
Douglas McNaught wrote:
>>Which will be the same as the second call. There is quite a big
>>difference in performance using bind variables.
>>
>>Does Postgres work the same? Where can I go for more info?
> 
> You can do this (or close to it) but you need to explicitly PREPARE
> the query (or use the protocol-level prepare, which some client
> libraries will do for you).  See the SQL documentation for PREPARE.
> 
> -Doug

Hi,

But this is of no use in a web-context. According to the docs, this 
prepare is per session.

This sql cache I think is a really good thing. Is there a reason
Postgres hasn't got it? Would it be very hard to implement? From
a naive perspective; make a hashvalue from the sql-string to
quickly find the cached one, a "last used"-list for keeping
track of which to delete when cache full etc seems close to
trivial. Does the architecture/internal flow make it hard
actually reuse the query data structure?

Thanks for the answer.

Best regards,
Marcus


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: PG_DUMP and table locking in PG7.4
Next
From: Martijn van Oosterhout
Date:
Subject: Re: bind variables, soft vs hard parse