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: 87k6s8x4q5.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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.

--
greg

In response to

Responses

Browse pgsql-hackers by date

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