Re: UPDATE with JOIN not using index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: arnaud(dot)listes(at)codata(dot)eu
Cc: Richard Huxton <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: UPDATE with JOIN not using index
Date: 2010-03-16 15:52:25
Message-ID: 9689.1268754745@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Arnaud Lesauvage <arnaud(dot)listes(at)codata(dot)eu> writes:
> I am still a bit intrigued by the different query plans. Both query look
> very similar to me, so why does the planner make so different choices ?

Sometime in the future they might generate the same plan. Right now the
planner's ability to optimize sub-SELECTs is pretty limited, and so you
typically get a nestloop-like plan even if some other join style would
be faster. (It's not all the planner's fault either --- we'd need to
tweak the executor so that it could throw the appropriate error for more
than one join partner row, etc.)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arnaud Lesauvage 2010-03-16 16:03:46 Re: UPDATE with JOIN not using index
Previous Message Tom Lane 2010-03-16 15:46:58 Re: Move to core xml from contrib/xml2