Re: Update command too slow

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Update command too slow
Дата
Msg-id 23614.1107622620@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Update command too slow  (Venkatesh Babu <venkatbabukr@yahoo.com>)
Ответы Re: Update command too slow  (Venkatesh Babu <venkatbabukr@yahoo.com>)
Список pgsql-general
Venkatesh Babu <venkatbabukr@yahoo.com> writes:
> There aren't any triggers but there are 75262 update
> statements. The problem is that we have a datatype
> called as "Collection" and we are fetching the data
> rows into it, modifying the data and call
> Collection.save(). This save method generates one
> update satement per record present in it.

Well, that's going to be dog-slow in any case compared to putting the
logic on the server side, but a couple of things you could possibly
do: make sure all of this is in one transaction block (a commit per
row updated is a lot of overhead) and use a prepared statement for the
UPDATE to get you out from under the repeated parse/plan overhead.
Check the UPDATE's plan, too, and make sure it's an indexscan on the
primary key rather than anything less efficient.

            regards, tom lane

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: pgpool simple feature request
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Is there a peer-to-peer server solution with PG?