Remove the vacuum_delay_point call in count_nondeletable_pages, because we hold
authorAlvaro Herrera <[email protected]>
Mon, 10 Sep 2007 17:58:56 +0000 (17:58 +0000)
committerAlvaro Herrera <[email protected]>
Mon, 10 Sep 2007 17:58:56 +0000 (17:58 +0000)
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.

src/backend/commands/vacuumlazy.c

index 9a24d25508506427ef1d56681df52b5e2d4435b4..c0b3f6402e6cb63e0d6ab3cdecb5fd612ff449e9 100644 (file)
@@ -854,7 +854,11 @@ count_nondeletable_pages(Relation onerel, LVRelStats *vacrelstats)
                bool            tupgone,
                                        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--;