> -> Seq Scan on table1 (cost=0.00..20.00 rows=1000 width=0) (actual
Run VACUUM ANALYZE, then repost your EXPLAIN ANALYZE results please.