Commit 21c27af6 authored by Alvaro Herrera's avatar Alvaro Herrera

Remove the vacuum_delay_point call in count_nondeletable_pages, because we hold

an exclusive lock on the table at this point, which we want to release as soon
as possible.  This is called in the phase of lazy vacuum where we truncate the
empty pages at the end of the table.

An alternative solution would be to lower the vacuum delay settings before
starting the truncating phase, but this doesn't work very well in autovacuum
due to the autobalancing code (which can cause other processes to change our
cost delay settings).  This case could be considered in the balancing code, but
it is simpler this way.
parent d982daae
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.91 2007/09/05 18:10:47 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.92 2007/09/10 17:58:45 alvherre Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -868,7 +868,11 @@ count_nondeletable_pages(Relation onerel, LVRelStats *vacrelstats) ...@@ -868,7 +868,11 @@ count_nondeletable_pages(Relation onerel, LVRelStats *vacrelstats)
bool tupgone, bool tupgone,
hastup; hastup;
vacuum_delay_point(); /*
* We don't insert a vacuum delay point here, because we have an
* exclusive lock on the table which we want to hold for as short
* a time as possible.
*/
blkno--; blkno--;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment