Re: Analyze and vacuum, they are sort of mandatory.... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Analyze and vacuum, they are sort of mandatory....
Date
Msg-id 17016.1139761083@sss.pgh.pa.us
Whole thread Raw
In response to Re: Analyze and vacuum, they are sort of mandatory....  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Analyze and vacuum, they are sort of mandatory....
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Yes, that is what autovacuum does.  It detects changes in the database 
> and runs analyze if failing to do so would cause PostgreSQL to behave 
> badly.  I don't know why it's not turned on by default.

Conservatism.  It may well be on by default in some future release,
but that's not happening in the first release where the code exists
at all.

autovacuum isn't a 100% solution to the sort of problems Mark is
complaining about anyway: on a freshly-loaded table you could get bad
plans because autovacuum hadn't gotten to it yet.

One thing we could consider doing is boosting up the default no-stats
assumption about the number of distinct values in a column, to the point
where the planner wouldn't try a hash aggregate unless it had actual
stats.  However, I'm unsure what negative side-effects that might have.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: SpeedComparison
Next
From: Simon Riggs
Date:
Subject: Re: Scrollable cursors and Sort performance