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

From Tom Lane
Subject Re: UPDATE with JOIN not using index
Date
Msg-id 9689.1268754745@sss.pgh.pa.us
Whole thread Raw
In response to Re: 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
Arnaud Lesauvage <arnaud.listes@codata.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Move to core xml from contrib/xml2
Next
From: Arnaud Lesauvage
Date:
Subject: Re: UPDATE with JOIN not using index