aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2007-09-10 17:58:56 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2007-09-10 17:58:56 +0000
commite52f4ec325c08f11739607b4571dba040c9075a9 (patch)
tree5bb0902c5c96bae814b52145a5fbc1ef2ecb7edf
parent015659330fa933251143d63072ec884b45f812a2 (diff)
downloadpostgresql-e52f4ec325c08f11739607b4571dba040c9075a9.tar.gz
postgresql-e52f4ec325c08f11739607b4571dba040c9075a9.zip
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.
-rw-r--r--src/backend/commands/vacuumlazy.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c
index 4691de038bc..dd426b4f309 100644
--- a/src/backend/commands/vacuumlazy.c
+++ b/src/backend/commands/vacuumlazy.c
@@ -31,7 +31,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.61.2.2 2006/03/04 19:09:23 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.61.2.3 2007/09/10 17:58:56 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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--;