Seq Scan on table1 (cost=10024.60..630494296.45 rows=139636 width=4) Filter: (NOT (subplan)) SubPlan -> Materialize (cost=10024.60..13890.51 rows=259691 width=4) -> Seq Scan on table2 (cost=0.00..8495.91 rows=259691 width=4)