aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/hash/hash.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-02-11 17:14:09 +0000
committerBruce Momjian <bruce@momjian.us>2006-02-11 17:14:09 +0000
commit77bb65d3fcdd2b588cec4b94af05e3d3f30e80cc (patch)
tree36929633459fe21c8eae3a03bfcdb1e1e5a6511d /src/backend/access/hash/hash.c
parentbf324946b32736da1b128b1e742515879b42a4e8 (diff)
downloadpostgresql-77bb65d3fcdd2b588cec4b94af05e3d3f30e80cc.tar.gz
postgresql-77bb65d3fcdd2b588cec4b94af05e3d3f30e80cc.zip
Revert based on Tom's recommendation:
> Allow VACUUM to complete faster by avoiding scanning the indexes when no > rows were removed from the heap by the VACUUM.
Diffstat (limited to 'src/backend/access/hash/hash.c')
-rw-r--r--src/backend/access/hash/hash.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c
index 548901a9be4..cb82a38d901 100644
--- a/src/backend/access/hash/hash.c
+++ b/src/backend/access/hash/hash.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.84 2006/02/11 16:59:09 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.85 2006/02/11 17:14:08 momjian Exp $
*
* NOTES
* This file contains only the public interface routines.
@@ -496,17 +496,6 @@ hashbulkdelete(PG_FUNCTION_ARGS)
tuples_removed = 0;
num_index_tuples = 0;
- /* return statistics */
- num_pages = RelationGetNumberOfBlocks(rel);
-
- result = (IndexBulkDeleteResult *) palloc0(sizeof(IndexBulkDeleteResult));
- result->num_pages = num_pages;
-
- if (!callback_state)
- {
- PG_RETURN_POINTER(result);
- }
-
/*
* Read the metapage to fetch original bucket and tuple counts. Also, we
* keep a copy of the last-seen metapage so that we can use its
@@ -655,6 +644,11 @@ loop_top:
_hash_wrtbuf(rel, metabuf);
+ /* return statistics */
+ num_pages = RelationGetNumberOfBlocks(rel);
+
+ result = (IndexBulkDeleteResult *) palloc0(sizeof(IndexBulkDeleteResult));
+ result->num_pages = num_pages;
result->num_index_tuples = num_index_tuples;
result->tuples_removed = tuples_removed;