Re: UPDATE with JOIN not using index - Mailing list pgsql-general

From Richard Huxton
Subject Re: UPDATE with JOIN not using index
Date
Msg-id 4B9F8CA8.7080004@archonet.com
Whole thread Raw
In response to UPDATE with JOIN not using index  (Arnaud Lesauvage <arnaud.listes@codata.eu>)
Responses Re: UPDATE with JOIN not using index  (Arnaud Lesauvage <arnaud.listes@codata.eu>)
List pgsql-general
On 16/03/10 13:05, Arnaud Lesauvage wrote:
> Hi all !
>
> PostgreSQL 8.4 here.
> I have a simple update query that looks like this :
>
> UPDATE t1
> SET col = t2.col
> FROM t2
> WHERE t1.key1 = t2.key1 AND t1.key2 = t2.key2;
>
> There is an index on (key1,key2) on the joined table (t2).
> This query does not use the index.

What does it do, then? The output of EXPLAIN would be a start if EXPLAIN
ANALYSE is too expensive.

Oh - and how many rows will this actually update?

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Text search
Next
From: Arnaud Lesauvage
Date:
Subject: Re: UPDATE with JOIN not using index