plan of
http://archives.postgresql.org/pgsql-bugs/2012-09/msg00222.phptest=# explain select max(a.info)from sli_test a where a.id not in(select b.id from sli_test2 b where b.id<50000);
QUERY PLAN
---------------------------------------------------------------------------------------
Aggregate (cost=9243466274.00..9243466274.01 rows=1 width=12)
-> Seq Scan on sli_test a (cost=0.00..9243465024.00 rows=500000 width=12)
Filter: (NOT (SubPlan 1))
SubPlan 1
-> Materialize (cost=0.00..18359.60 rows=50919 width=4)
-> Seq Scan on sli_test2 b (cost=0.00..17906.00 rows=50919 width=4)
Filter: (id < 50000)