aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/heap/rewriteheap.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-10-07 21:46:46 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2010-10-07 21:46:46 -0400
commit9cc8c84e738737baed4b7edeaaa2bee35ad38847 (patch)
tree5a2cecd2c054cd7fd6f2bb4947767bd5dcf42ca2 /src/backend/access/heap/rewriteheap.c
parent26a7b48e10bea67be719f5bb88cbaa8d4ec1c9b3 (diff)
downloadpostgresql-9cc8c84e738737baed4b7edeaaa2bee35ad38847.tar.gz
postgresql-9cc8c84e738737baed4b7edeaaa2bee35ad38847.zip
Improve logging in VACUUM FULL VERBOSE and CLUSTER VERBOSE.
This patch resurrects some of the information that could be logged by the old, now-dead implementation of VACUUM FULL, in particular counts of live and dead tuples and the time taken for the table rebuild proper. There's still no logging about the ensuing index rebuilds, though. Itagaki Takahiro
Diffstat (limited to 'src/backend/access/heap/rewriteheap.c')
-rw-r--r--src/backend/access/heap/rewriteheap.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index a5150363f93..0bd18650682 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -254,8 +254,6 @@ end_heap_rewrite(RewriteState state)
/*
* Write any remaining tuples in the UnresolvedTups table. If we have any
* left, they should in fact be dead, but let's err on the safe side.
- *
- * XXX this really is a waste of code no?
*/
hash_seq_init(&seq_status, state->rs_unresolved_tups);
@@ -502,8 +500,12 @@ rewrite_heap_tuple(RewriteState state,
* Register a dead tuple with an ongoing rewrite. Dead tuples are not
* copied to the new table, but we still make note of them so that we
* can release some resources earlier.
+ *
+ * Returns true if a tuple was removed from the unresolved_tups table.
+ * This indicates that that tuple, previously thought to be "recently dead",
+ * is now known really dead and won't be written to the output.
*/
-void
+bool
rewrite_heap_dead_tuple(RewriteState state, HeapTuple old_tuple)
{
/*
@@ -539,7 +541,10 @@ rewrite_heap_dead_tuple(RewriteState state, HeapTuple old_tuple)
hash_search(state->rs_unresolved_tups, &hashkey,
HASH_REMOVE, &found);
Assert(found);
+ return true;
}
+
+ return false;
}
/*