Re: Prepared statements considered harmful

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Prepared statements considered harmful
Дата
Msg-id 200608312001.10245.peter_e@gmx.net
обсуждение исходный текст
Ответ на Re: Prepared statements considered harmful  (Gregory Stark <stark@enterprisedb.com>)
Ответы Re: Prepared statements considered harmful
Re: Prepared statements considered harmful
Re: Prepared statements considered harmful
Список pgsql-hackers
Gregory Stark wrote:
> Then you would be going very much against the user's expectations.
>
> Driver interfaces expose very clearly to the user an explicit
> interface to prepare and execute a query separately. What your
> proposing is to go behind the user's back and do what he's gone out
> of his way to tell you not to do. You can always choose to prepare
> your queries immediately before use. Most drivers even supply an
> interface to do so in a single step for convenience.

Let's verify that.  JDBC and PL/pgSQL have been mentioned.

The JDBC documentation merely contains statements of the sort "A SQL 
statement with or without IN parameters can be pre-compiled and stored 
in a PreparedStatement object. This object can then be used to 
efficiently execute this statement multiple times."  There is 
absolutely no indication that the execution plan of the statement is 
computed at the time of preparation.  In fact, it doesn't say 
what "pre-compiled" means at all.

For PL/pgSQL, you simply write a query and all the preparing action 
happens implicitly.  There is nothing explicit about that interface.

So if users have certain expectations here, they're just making them up.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Second try committing the path changes.
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Prepared statements considered harmful