Re: pgAdmin complains about vacuuming required after fresh 8.1 install

From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Collin Peters" <cadiolis(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pgAdmin complains about vacuuming required after fresh 8.1 install
Date: 2008-06-12 08:23:11
Message-ID: 937d27e10806120123t16532a5ds4c214e067319f3f2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 12, 2008 at 7:18 AM, Collin Peters <cadiolis(at)gmail(dot)com> wrote:
> Bump
>
> Does anyone have *any* thoughts on this? This seems to be a fairly
> common problem. Does anybody have any good links that they can
> provide to find an answer?
>
> My current test is that I have a table where all the rows were purged,
> and then new ones inserted using a specific job. pgAdmin reports 0
> estimated rows and 46 counted rows and therefore displays the popup
> saying a vacuum should be run. I see in the PostgreSQL log that
> autovacuum is vacuuming this database regularly.
>
> Is this simply because pgAdmin has tighter settings and autovacuum
> hasn't actually done anything with this table yet?
>

pgAdmin's code for that is far older than PostgreSQL's:

bool pgTable::GetVacuumHint()
{
bool canHint=false;

if (rowsCounted)
{
if (!estimatedRows || (estimatedRows == 1000 &&
rows.GetValue() != 1000))
canHint = (rows >= 20);
else
{
double rowsDbl=(wxLongLong_t)rows.GetValue();
double quot=rowsDbl *10. / estimatedRows;
canHint = ((quot > 12 || quot < 8) && (rowsDbl <
estimatedRows-20. || rowsDbl > estimatedRows+20.));
}
}
else if (estimatedRows == 1000)
{
canHint = true;
}
return canHint;
}

in there, estimatedRows is the number of rows noted in the pg_class
entry, and rows is the number of rows actually counted in the table,
if rowsCounted is true (which will be the case if you've forced a
count from the menu, or the row count threshold (under File ->
Options) is >= estimatedRows) .

Suggestions for improvements are welcome.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2008-06-12 08:25:05 Re: pl/pgsql function with argument of type DATE
Previous Message Giorgio Valoti 2008-06-12 08:18:51 to_tsvector: error with italian configuration