git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dfc9028)
Fix serious performance bug in new implementation of VACUUM FULL:
Mon, 8 Feb 2010 16:50:21 +0000 (16:50 +0000)
Mon, 8 Feb 2010 16:50:21 +0000 (16:50 +0000)
cluster_rel necessarily builds an all-new toast table, so it's useless to
then go and VACUUM FULL the toast table.


diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index c96c8400cc614f6f6bf2423c5fc3302b922adc4f..599a24412d1eee92b7636531040d4727230cef8d 100644 (file)
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.405 2010年02月08日 04:33:53 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.406 2010年02月08日 16:50:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -938,9 +938,10 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, bool do_toast, bool for_wraparound,
/*
* Remember the relation's TOAST relation for later, if the caller asked
- * us to process it.
+ * us to process it. In VACUUM FULL, though, the toast table is
+ * automatically rebuilt by cluster_rel so we shouldn't recurse to it.
*/
- if (do_toast)
+ if (do_toast && !(vacstmt->options & VACOPT_FULL))
toast_relid = onerel->rd_rel->reltoastrelid;
else
toast_relid = InvalidOid;
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /