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