From 23c4978e6c3bea403408949f9b7ab0949d76bc3f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 5 Feb 2007 04:22:18 +0000 Subject: Rename MaxTupleSize to MaxHeapTupleSize to clarify that it's not meant to describe the maximum size of index tuples (which is typically AM-dependent anyway); and consequently remove the bogus deduction for "special space" that was built into it. Adjust TOAST_TUPLE_THRESHOLD and TOAST_MAX_CHUNK_SIZE to avoid wasting two bytes per toast chunk, and to ensure that the calculation correctly tracks any future changes in page header size. The computation had been inaccurate in a way that didn't cause any harm except space wastage, but future changes could have broken it more drastically. Fix the calculation of BTMaxItemSize, which was formerly computed as 1 byte more than it could safely be. This didn't cause any harm in practice because it's only compared against maxalign'd lengths, but future changes in the size of page headers or btree special space could have exposed the problem. initdb forced because of change in TOAST_MAX_CHUNK_SIZE, which alters the storage of toast tables. --- src/backend/commands/vacuum.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/commands') diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 43647d7989f..5f9f787eeea 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.344 2007/02/01 19:10:26 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.345 2007/02/05 04:22:18 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1236,7 +1236,7 @@ scan_heap(VRelStats *vacrelstats, Relation onerel, nunused; double free_space, usable_free_space; - Size min_tlen = MaxTupleSize; + Size min_tlen = MaxHeapTupleSize; Size max_tlen = 0; bool do_shrinking = true; VTupleLink vtlinks = (VTupleLink) palloc(100 * sizeof(VTupleLinkData)); -- cgit v1.2.3