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

Re: Autovacuum versus rolled-back transactions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Autovacuum versus rolled-back transactions
Date: 2007-06-01 03:19:18
Message-ID: 16011.1180667958@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
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.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-06-01 03:22:40
Subject: Re: Autovacuum versus rolled-back transactions
Previous:From: Alvaro HerreraDate: 2007-06-01 02:21:08
Subject: Re: Autovacuum versus rolled-back transactions

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