QUERY PLAN -------------------------------------------------------------------------------------------------- Merge Join (cost=xxx rows=100 width=29) Merge Cond: (t1.c1 = t2.c1) InitPlan 1 (returns $0) -> Aggregate (cost=xxx rows=1 width=4) -> Merge Join (cost=xxx rows=100 width=4) Merge Cond: (t1_1.c1 = t2_1.c1) -> Index Only Scan using t1_i1 on t1 t1_1 (cost=xxx rows=1000 width=4) -> Sort (cost=xxx rows=100 width=4) Sort Key: t2_1.c1 -> Seq Scan on t2 t2_1 (cost=xxx rows=100 width=4) -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15) -> Sort (cost=xxx rows=100 width=14) Sort Key: t2.c1 -> Seq Scan on t2 (cost=xxx rows=100 width=14) (14 rows) QUERY PLAN -------------------------------------------------------------------------------------------------- Merge Join (cost=xxx rows=100 width=29) Merge Cond: (t1.c1 = t2.c1) InitPlan 1 (returns $0) -> Aggregate (cost=xxx rows=1 width=4) -> Merge Join (cost=xxx rows=1 width=4) Merge Cond: (t1_1.c1 = t2_1.c1) -> Index Only Scan using t1_i1 on t1 t1_1 (cost=xxx rows=1000 width=4) -> Sort (cost=xxx rows=100 width=4) Sort Key: t2_1.c1 -> Seq Scan on t2 t2_1 (cost=xxx rows=100 width=4) -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15) -> Sort (cost=xxx rows=100 width=14) Sort Key: t2.c1 -> Seq Scan on t2 (cost=xxx rows=100 width=14) (14 rows) QUERY PLAN ------------------------------------------------------------------------------------------------- Merge Join (cost=xxx rows=1 width=29) Merge Cond: (t1.c1 = t2.c1) InitPlan 1 (returns $0) -> Aggregate (cost=xxx rows=1 width=4) -> Merge Join (cost=xxx rows=1 width=4) Merge Cond: (st1.c1 = st2.c1) -> Index Only Scan using t1_i1 on t1 st1 (cost=xxx rows=1000 width=4) -> Sort (cost=xxx rows=100 width=4) Sort Key: st2.c1 -> Seq Scan on t2 st2 (cost=xxx rows=100 width=4) -> Index Scan using t1_i1 on t1 (cost=xxx rows=1000 width=15) -> Sort (cost=xxx rows=100 width=14) Sort Key: t2.c1 -> Seq Scan on t2 (cost=xxx rows=100 width=14) (14 rows)