Craig James <craig_james(at)emolecules(dot)com> writes:
> Auto-vacuum has made Postgres a much more "friendly" system. Is there some reason the planner can't also auto-ANALYZE in some situations?
autovacuum handles analyze too. Trying to make the planner do it is
a crummy idea for a couple of reasons:
* unpredictable performance if queries sometimes go off for a few
seconds to collect stats
* pg_statistics update requires semi-exclusive lock
* work is lost if transaction later rolls back
regards, tom lane