Something I've noticed frequently is that HashAggregate will, especially if the children are Append with one of the nodes a non-seqscan, estimate 200 rows rather than a calculated vlaue. Where is that value coming from? The statistics target, a hardwired constant, or something else?
--
-- Christophe Pettus
xof(at)thebuild(dot)com