Re: prepared statement functioning range

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: prepared statement functioning range
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B17BB2BA5@ntex2010a.host.magwien.gv.at
обсуждение исходный текст
Ответ на prepared statement functioning range  (高健 <luckyjackgao@gmail.com>)
Список pgsql-general
高健  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

В списке pgsql-general по дате отправления:

Предыдущее
От: 高健
Дата:
Сообщение: prepared statement functioning range
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Why hash join cost calculation need reduction