Re: Cached Query Plans

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Cached Query Plans
Дата
Msg-id 87lk3kdky4.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Cached Query Plans  (PFC <lists@peufeu.com>)
Ответы Re: Cached Query Plans  (PFC <lists@peufeu.com>)
Список pgsql-hackers
"PFC" <lists@peufeu.com> writes:

>     But, using prepared statements with persistent connections is messy,
> because you never know if the connection is new or not, if it contains  already
> prepared statements or not, you'd have to maintain a list of those  statements
> (named) for every query in your application, and when someone  changes a query,
> it's a mess, not to mention queries generated by the ORM  like Rails etc.

Well if you're caching per-connection then it doesn't really matter whether
you do it on the client side or the server side, it's pretty much exactly the
same problem.

Unsurprisingly most drivers do precisely what you're describing. In Perl DBI
for example you just change $dbh->prepare("") into $dbh->prepare_cached("")
and it does exactly what you want. I would expect the PHP drivers to have
something equivalent.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's Slony Replication
support!


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Cached Query Plans
Следующее
От: Ron Mayer
Дата:
Сообщение: Re: Index AM change proposals, redux