aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/analyze.c24
-rw-r--r--src/backend/commands/vacuum.c4
-rw-r--r--src/backend/commands/vacuumlazy.c4
3 files changed, 29 insertions, 3 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 33447b671f1..176ebde0efd 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.133 2009/01/22 20:16:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.134 2009/03/24 20:17:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -496,6 +496,28 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt,
/* We skip to here if there were no analyzable columns */
cleanup:
+ /* If this isn't part of VACUUM ANALYZE, let index AMs do cleanup */
+ if (!vacstmt->vacuum)
+ {
+ for (ind = 0; ind < nindexes; ind++)
+ {
+ IndexBulkDeleteResult *stats;
+ IndexVacuumInfo ivinfo;
+
+ ivinfo.index = Irel[ind];
+ ivinfo.vacuum_full = false;
+ ivinfo.analyze_only = true;
+ ivinfo.message_level = elevel;
+ ivinfo.num_heap_tuples = -1; /* not known for sure */
+ ivinfo.strategy = vac_strategy;
+
+ stats = index_vacuum_cleanup(&ivinfo, NULL);
+
+ if (stats)
+ pfree(stats);
+ }
+ }
+
/* Done with indexes */
vac_close_indexes(nindexes, Irel, NoLock);
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 4020bf1b294..78b179827ea 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.385 2009/01/16 13:27:23 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.386 2009/03/24 20:17:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3388,6 +3388,7 @@ scan_index(Relation indrel, double num_tuples)
ivinfo.index = indrel;
ivinfo.vacuum_full = true;
+ ivinfo.analyze_only = false;
ivinfo.message_level = elevel;
ivinfo.num_heap_tuples = num_tuples;
ivinfo.strategy = vac_strategy;
@@ -3454,6 +3455,7 @@ vacuum_index(VacPageList vacpagelist, Relation indrel,
ivinfo.index = indrel;
ivinfo.vacuum_full = true;
+ ivinfo.analyze_only = false;
ivinfo.message_level = elevel;
ivinfo.num_heap_tuples = num_tuples + keep_tuples;
ivinfo.strategy = vac_strategy;
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c
index 4e4624cb132..cb73cfa87a7 100644
--- a/src/backend/commands/vacuumlazy.c
+++ b/src/backend/commands/vacuumlazy.c
@@ -29,7 +29,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.118 2009/01/22 19:25:00 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.119 2009/03/24 20:17:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -875,6 +875,7 @@ lazy_vacuum_index(Relation indrel,
ivinfo.index = indrel;
ivinfo.vacuum_full = false;
+ ivinfo.analyze_only = false;
ivinfo.message_level = elevel;
/* We don't yet know rel_tuples, so pass -1 */
ivinfo.num_heap_tuples = -1;
@@ -906,6 +907,7 @@ lazy_cleanup_index(Relation indrel,
ivinfo.index = indrel;
ivinfo.vacuum_full = false;
+ ivinfo.analyze_only = false;
ivinfo.message_level = elevel;
ivinfo.num_heap_tuples = vacrelstats->rel_tuples;
ivinfo.strategy = vac_strategy;