From: | Dave Page <dpage(at)postgresql(dot)org> |
---|---|
To: | Joost Kraaijeveld <J(dot)Kraaijeveld(at)Askesis(dot)nl> |
Cc: | pgadmin-support(at)postgresql(dot)org |
Subject: | Re: vacuum tip question |
Date: | 2006-11-26 19:35:57 |
Message-ID: | 4569EC9D.9050003@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-support |
Joost Kraaijeveld wrote:
> Hi,
>
> I am using auto-vacuum (autovacuum = on) but sometimes PGAdmin warns me
> that I need to enable autovacuum or do it manually.
>
> How does PgAdmin determine that it is necessary to run vacuum?
Using the following code:
bool pgTable::GetVacuumHint()
{
bool canHint=false;
if (rowsCounted) // We've explicitly counted the rows
{
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;
}
Regards, Dave
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2006-11-27 11:32:19 | Re: text_pattern_ops not shown in index command |
Previous Message | Dave Page | 2006-11-26 19:26:44 | Re: Newbie questions, diff between functions and |