This script is lacking a VACUUM or ANALYZE command, so the planner doesn't know how large the table is. Note the ridiculously small cost estimates in EXPLAIN ...
I see, I never knew about having to VACUUM/ANALYZE first. Thanks.
-- dave
---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?
http://archives.postgresql.org