From b3005276eb42bbe9c0975ab8d9aa6f1ebe86850c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 3 Apr 2007 04:14:26 +0000 Subject: Decouple the values of TOAST_TUPLE_THRESHOLD and TOAST_MAX_CHUNK_SIZE. Add the latter to the values checked in pg_control, since it can't be changed without invalidating toast table content. This commit in itself shouldn't change any behavior, but it lays some necessary groundwork for experimentation with these toast-control numbers. Note: while TOAST_TUPLE_THRESHOLD can now be changed without initdb, some thought still needs to be given to needs_toast_table() in toasting.c before unleashing random changes. --- doc/src/sgml/storage.sgml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/storage.sgml b/doc/src/sgml/storage.sgml index 8a2e7929e62..1973a5b90c3 100644 --- a/doc/src/sgml/storage.sgml +++ b/doc/src/sgml/storage.sgml @@ -1,4 +1,4 @@ - + @@ -240,8 +240,9 @@ of the LZ family of compression techniques. See Out-of-line values are divided (after compression if used) into chunks of at -most TOAST_MAX_CHUNK_SIZE bytes (this value is a little less than -BLCKSZ/4, or about 2000 bytes by default). Each chunk is stored +most TOAST_MAX_CHUNK_SIZE bytes (by default this value is chosen +so that four chunk rows will fit on a page, making it about 2000 bytes). +Each chunk is stored as a separate row in the TOAST table for the owning table. Every TOAST table has the columns chunk_id (an OID identifying the particular TOASTed value), @@ -260,10 +261,12 @@ regardless of the actual size of the represented value. The TOAST code is triggered only -when a row value to be stored in a table is wider than BLCKSZ/4 -bytes (normally 2 kB). The TOAST code will compress and/or move +when a row value to be stored in a table is wider than +TOAST_TUPLE_THRESHOLD bytes (normally 2 kB). +The TOAST code will compress and/or move field values out-of-line until the row value is shorter than -BLCKSZ/4 bytes or no more gains can be had. During an UPDATE +TOAST_TUPLE_TARGET bytes (also normally 2 kB) +or no more gains can be had. During an UPDATE operation, values of unchanged fields are normally preserved as-is; so an UPDATE of a row with out-of-line values incurs no TOAST costs if none of the out-of-line values change. -- cgit v1.2.3