QUERY PLAN ---------------------------------------------------------------------- Hash Left Join (cost=58.15..39850.22 rows=11449 width=16) Hash Cond: (a.i = b.i) -> Seq Scan on tab1 a (cost=0.00..39388.68 rows=1070 width=8) Filter: (SubPlan 1) SubPlan 1 -> Seq Scan on tab2 (cost=0.00..36.75 rows=11 width=4) Filter: (k = a.j) -> Hash (cost=31.40..31.40 rows=2140 width=8) -> Seq Scan on tab1 b (cost=0.00..31.40 rows=2140 width=8) (9 rows)