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

Re: Possible TODO item? VACUUM on empty table

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Possible TODO item? VACUUM on empty table
Date: 2004-11-26 10:52:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Richard Huxton <dev(at)archonet(dot)com> writes:

> So - would it be worth, in the case of vacuum+analyse (but not analyse alone),
> where the table is completely empty then just halve the existing stats.
> That way, if you're in the middle of a delete/replace cycle your stats will
> still be in the realms of reasonableness. On the other hand, if the table is
> genuinely empty and you're running a nightly vacuum the stats will tend toward
> 0.
> Against the idea:
> 1. It's a special-case in the code

Hm. I suppose the generalization of this would be to always average the new
stats with the existing stats.

I suppose you could make the argument that if I run analyze and then run
analyze again without changing anything then I've effectively doubled the
sample size and the stats can take advantage of that.

But not all of the stats are simple totals. I'm not sure this would make sense
for the histogram arrays.


In response to


pgsql-hackers by date

Next:From: Andreas PflugDate: 2004-11-26 10:55:18
Subject: Question to tea leaf readers
Previous:From: Pawel NiewiadomskiDate: 2004-11-26 10:25:41
Subject: Re: Bitmap index

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