View Single Post

   
  #8 (permalink)  
Old 04-12-2008, 08:54 AM
Tom Lane
 
Posts: n/a
Default Re: Autovacuum versus rolled-back transactions

ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply With Quote