Re: Analyze and vacuum, they are sort of mandatory....

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Mark Woodward" <pgsql(at)mohawksoft(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Analyze and vacuum, they are sort of mandatory....
Date: 2006-02-12 16:18:03
Message-ID: 17016.1139761083@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-02-12 16:30:16 Re: [HACKERS] Spaces in psql output (Was: FW: PGBuildfarm member snake Branch HEAD Status changed)
Previous Message Tom Lane 2006-02-12 16:11:41 Re: SpeedComparison