Re: pgAdmin complains about vacuuming required after fresh 8.1 install

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: pgAdmin complains about vacuuming required after fresh 8.1 install
Дата
Msg-id 937d27e10806120123t16532a5ds4c214e067319f3f2@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgAdmin complains about vacuuming required after fresh 8.1 install  ("Collin Peters" <cadiolis@gmail.com>)
Список pgsql-general
On Thu, Jun 12, 2008 at 7:18 AM, Collin Peters <cadiolis@gmail.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Giorgio Valoti
Дата:
Сообщение: to_tsvector: error with italian configuration
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: pl/pgsql function with argument of type DATE