Does preparing statements other than selects help performance?

Поиск
Список
Период
Сортировка
От David Goodenough
Тема Does preparing statements other than selects help performance?
Дата
Msg-id 200508051008.42597.david.goodenough@btconnect.com
обсуждение исходный текст
Ответы Re: Does preparing statements other than selects help performance?  (Martijn van Oosterhout <kleptog@svana.org>)
Re: Does preparing statements other than selects help performance?  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
I was looking at an application recently which was written in Java and used
Postgresql as it DB.  In it extensive use had been made of PreparedStatements
both for SELECTs and for INSERT, UPDATE and DELETE statements.  Some of
the routines had multiple UPDATEs doing much the same thing but with
slightly different parameters.  In the comments it was stated that it was
better to prepare lots of statements in advance rather than build one on the
spot (and then prepare it, it needed the substitution) because of the
optimiser.

This set me thinking (always dangerous).  I can see how a SELECT can be
helped by preparing the statement, but not really how an INSERT could
or, other than the SELECT implicit in the WHERE clause on an UPDATE or
DELETE, how UPDATE or DELETE statements would be helped.

Can anyone enlighten me please?

David

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

Предыдущее
От: Ben-Nes Yonatan
Дата:
Сообщение: Weird lock or bug maybe?
Следующее
От: go
Дата:
Сообщение: Re: Weird lock or bug maybe?