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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Feite Brekeveld <feite(dot)brekeveld(at)osiris-it(dot)nl>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: update ... from where id in (..) question
Date: 2001-05-02 22:25:48
Message-ID: 17224.988842348@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Feite Brekeveld <feite(dot)brekeveld(at)osiris-it(dot)nl> writes:
> 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.

What postgres version? What does EXPLAIN show for the two queries?
Have you VACUUM ANALYZEd that table recently?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joel Burton 2001-05-02 22:28:59 Re: Tuple Max Size on 7.1
Previous Message Tom Lane 2001-05-02 22:10:28 Re: Strange SERIAL / Sequence error