Skip site navigation (1) Skip section navigation (2)

Re: Autovacuum versus rolled-back transactions

From: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>,Alvaro Herrera <alvherre(at)commandprompt(dot)com>,pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Autovacuum versus rolled-back transactions
Date: 2007-06-01 13:03:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Tom Lane wrote:
> ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> writes:
>> Our documentation says
>> | analyze threshold = analyze base threshold
>> |                       + analyze scale factor * number of tuples
>> | is compared to the total number of tuples inserted, updated, or deleted
>> | since the last ANALYZE. 
>> but deleted tuples are not considered in the total number, because the delta
>> of {n_live_tuples + n_dead_tuples} is not changed by DELETE. We add the number
>> of DELETE into n_live_tuples and subtract it from n_dead_tuples.
> Yeah, I was concerned about that when I was making the patch, but didn't
> see any simple fix.  A large number of DELETEs (without any inserts or
> updates) would trigger a VACUUM but not an ANALYZE, which in the worst
> case would be bad because the stats could have shifted.
> We could fix this at the cost of carrying another per-table counter in
> the stats info, but I'm not sure it's worth it.

I believe that whenever autovacuum performs a VACUUM it actually 
performs a VACUUM ANALYZE at leas the old contrib version did and I 
think Alvaro copied that.

In response to


pgsql-hackers by date

Next:From: Tasneem MemonDate: 2007-06-01 13:24:33
Subject: To all the pgsql developers..Have a look at the operators proposed by me in my research paper.
Previous:From: Andrew DunstanDate: 2007-06-01 11:16:16
Subject: Re: [HACKERS] like/ilike improvements

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group