summaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-07-22 01:21:22 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-07-22 01:21:22 +0000
commitca7c8168de76459380577eda56a3ed09b4f6195c (patch)
tree561625203c37d0d2fc0c6c246623e78df2063e21 /src/backend/access
parenta5375bf90304d0cc39b6ca9d5bb07c20ff51f2b3 (diff)
Tweak TOAST code so that columns marked with MAIN storage strategy are
not forced out-of-line unless that is necessary to make the row fit on a page. Previously, they were forced out-of-line if needed to get the row down to the default target size (1/4th page). Kevin Grittner
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/heap/tuptoaster.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c
index a3203085b7a..781bfd2e486 100644
--- a/src/backend/access/heap/tuptoaster.c
+++ b/src/backend/access/heap/tuptoaster.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.93 2009/06/11 14:48:54 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.94 2009/07/22 01:21:22 tgl Exp $
*
*
* INTERFACE ROUTINES
@@ -796,8 +796,12 @@ toast_insert_or_update(Relation rel, HeapTuple newtup, HeapTuple oldtup,
}
/*
- * Finally we store attributes of type 'm' external, if possible.
+ * Finally we store attributes of type 'm' externally. At this point
+ * we increase the target tuple size, so that 'm' attributes aren't
+ * stored externally unless really necessary.
*/
+ maxDataLen = TOAST_TUPLE_TARGET_MAIN - hoff;
+
while (heap_compute_data_size(tupleDesc,
toast_values, toast_isnull) > maxDataLen &&
rel->rd_rel->reltoastrelid != InvalidOid)