Re: Postgres and multiple updates in one statement

Поиск
Список
Период
Сортировка
От Joshua Tolley
Тема Re: Postgres and multiple updates in one statement
Дата
Msg-id 20090727133755.GI10077@eddie
обсуждение исходный текст
Ответ на Re: Postgres and multiple updates in one statement  (Scott Marlowe <scott.marlowe@gmail.com>)
Список pgsql-general
On Mon, Jul 27, 2009 at 07:31:37AM -0600, Scott Marlowe wrote:
> On Mon, Jul 27, 2009 at 2:10 AM, Jamie
> Lawrence-Jenner<jamie.jenner@autovhc.co.uk> wrote:
> > Do 1 pass to retrieve the 5 primary keys, then update all rows in parallel
>
> I would do 5 passes.  Better to have one update statement to reduce bloat.

You could possibly use UNION or UNION ALL to consolidate your 5 passes into
one pass. You could also possibly use UPDATE FROM to avoid having to return
the primary keys at all, and get the whole thing done in one query.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Вложения

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

Предыдущее
От: nha
Дата:
Сообщение: Re: Postgres and multiple updates in one statement
Следующее
От: "Jamie Lawrence-Jenner"
Дата:
Сообщение: Postgres and multiple updates in one statement