Re: UPDATE with JOIN not using index

From: Richard Huxton <dev(at)archonet(dot)com>
To: arnaud(dot)listes(at)codata(dot)eu
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: UPDATE with JOIN not using index
Date: 2010-03-16 13:50:32
Message-ID: 4B9F8CA8.7080004@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arnaud Lesauvage 2010-03-16 13:57:32 Re: UPDATE with JOIN not using index
Previous Message Richard Huxton 2010-03-16 13:49:16 Re: Text search