Alvaro Herrera wrote:
> Tom Lane wrote:
> > Alvaro Herrera <alvherre@commandprompt.com> writes:
> > > What I'm requesting here is that the sleep in count_nondeletable_pages()
> > > be removed and that change backpatched to 8.2 and 8.1.
> >
> > Are you sure that that is, and always will be, the only sleep in that
> > part of the code path?
>
> It is currently, as far as I can see, the only sleep. I think we could
> backpatch the removal of that call, and consider changing the
> cost_delay parameters when we acquire the exclusive lock in HEAD.
I noticed that autovacuum can reset VacuumCostDelay to a non-zero value
when the cost balancing code runs. Of course, we can reset the target
value so that resetting it does not cause a problem.
I propose applying this patch from 8.1 onwards. HEAD would get an
additional treatment to avoid the balancing problem.
Note that I am releasing the exclusive lock on the table after the
truncate is done.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support