Search Postgresql Archives

Re: prepared statement functioning range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



高健  wrote:
> Prepared statement is  only for  use in the same session at which it has been executed.
> It can not be shared via multiple sessions.

That is correct, see
http://www.postgresql.org/docs/current/static/sql-prepare.html

> That is, when in some special situations ,
> if I have to use mulitple connections between client applicaiton and postgresql database,
> I must consider this point if I want to get benifit from prepared statements.
> 
> So I am now thinking about the reason that prepared statement  can not cross over sessions.
> Maybe it is because of MVCC control?   So in order to make it simple, the prepared statement is in one
> session range?

Statement plans are kept only per session, so a prepared statement
across multiple transactions would not have any benefits unless
the architecture would be changed to keep cached statement plans
in shared memory (like Oracle has it, which is always a good
source for bugs).

Are there any other benefits do you expect from prepared statements?

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux