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

From Arnaud Lesauvage
Subject Re: UPDATE with JOIN not using index
Date
Msg-id 4B9F9F03.2020807@codata.eu
Whole thread Raw
In response to Re: UPDATE with JOIN not using index  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: UPDATE with JOIN not using index  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Le 16/03/2010 15:37, Tom Lane a écrit :
> Arnaud Lesauvage<arnaud.listes@codata.eu>  writes:
>>  First query :
>>  "Merge Join  (cost=699826.38..704333.80 rows=13548 width=836)"
>>  "  Merge Cond: (((c.rue)::text = (r.rue)::text) AND ((c.codesite)::text
>>  = (r.codesite)::text))"
>
>>  Second query :
>>  "Seq Scan on cellules c  (cost=0.00..5018080.39 rows=552343 width=823)"
>
> Please notice that the planner thinks the second plan is much more
> expensive than the first.  I think you will find that it's right.
> Using an index is not always the best way to do a query.

Yes indeed, I should have read the output of explain more thoroughly I
guess !
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 ?

Regards,
Arnaud

pgsql-general by date:

Previous
From: tv@fuzzy.cz
Date:
Subject: Re: UPDATE with JOIN not using index
Next
From: Arnaud Lesauvage
Date:
Subject: Re: UPDATE with JOIN not using index