Tom Lane wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Of course, if we could avoid the pgstat check completely that would be
> > even better. The amount of pgstat traffic that causes is ridiculous.
>
> Good point ... shouldn't we have already checked the stats before ever
> deciding to try to claim the table?
The second check is there to allow for some other worker (or manual
vacuum) having vacuumed it after we first checked, but which had
finished before we check the array of current jobs.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services