Re: update ... from where id in (..) question

Поиск
Список
Период
Сортировка
От Joel Burton
Тема Re: update ... from where id in (..) question
Дата
Msg-id Pine.LNX.4.21.0105021755560.21206-100000@olympus.scw.org
обсуждение исходный текст
Ответ на update ... from where id in (..) question  (Feite Brekeveld <feite.brekeveld@osiris-it.nl>)
Ответы Re: Re: update ... from where id in (..) question
Список pgsql-general
On Wed, 2 May 2001, Feite Brekeveld wrote:

> Hi,
>
> I have a table with approx.  2mln records.
>
> There were a few for which I had to update statusfield, so I did:
>
>         update table set statusflag = 'U' where id in ('id10', 'id20',
> 'id30');
>
> this took so long that I cancelled it, and used separate
>
>         update table set statusflag = 'U' where id = 'id10';
>
> statements, which were executed in a fraction of a second.
>
> Has someone an explanation for this ?

1) Next time, try WHERE ID = 'id10' OR ID = 'id20' OR ... and see if
that's better.

2) Explanation for this? Have you tried EXPLAIN UPDATE table ....
Post the output of that, and someone might be able to help you decipher
it.


HTH,
--
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington


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

Предыдущее
От: David Scholes
Дата:
Сообщение: Re: Tuple Max Size on 7.1
Следующее
От: Andy Koch
Дата:
Сообщение: Re: DROP TABLE wildcard