Teodor Sigaev wrote:
>
>> I found something strange with merge join. Let there are two table
>
> Sorry, postgresql's version is 8.4 from today CVS
For what it's worth - 8.4.0 gives as expected.
aap=# explain UPDATE t1
SET f1 = t1.f1 || t2.f1
FROM t2
WHERE t2.f1 = t1.f1 AND t2.f2 = t1.f2 AND t2.f3 = t1.f3 AND t2.f4 = t1.f4
; QUERY
PLAN
---------------------------------------------------------------------------------------------Merge Join
(cost=0.00..28522.60rows=1 width=142) Merge Cond: ((t1.f1 = t2.f1) AND (t1.f2 = t2.f2) AND (t1.f3 = t2.f3)
AND (t1.f4 = t2.f4)) -> Index Scan using i1 on t1 (cost=0.00..26090.94 rows=234839
width=110) -> Index Scan using i2 on t2 (cost=0.00..77.25 rows=600 width=104)
(4 rows)