diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-02-15 20:57:01 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-02-15 20:57:01 +0000 |
commit | 059e361481641b044fb6265b773d77231496eda5 (patch) | |
tree | ad8fec4422ea2e192e7e97266de85a999e40e2e6 /src/include | |
parent | 5341cddba8cefd1a2b219366485fd38529c04724 (diff) |
Although we can't support out-of-line TOAST storage in indexes (yet),
compressed storage works perfectly well. Might as well have a coherent
strategy for applying it, rather than the haphazard store-what-you-get
approach that was in the code before. The strategy I've set up here is
to attempt compression of any compressible index value exceeding
BLCKSZ/16, or about 500 bytes by default.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/tuptoaster.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/include/access/tuptoaster.h b/src/include/access/tuptoaster.h index 23f31aec522..05c4b2c1e40 100644 --- a/src/include/access/tuptoaster.h +++ b/src/include/access/tuptoaster.h @@ -6,7 +6,7 @@ * * Copyright (c) 2000, PostgreSQL Development Team * - * $Id: tuptoaster.h,v 1.8 2000/08/04 04:16:10 tgl Exp $ + * $Id: tuptoaster.h,v 1.9 2001/02/15 20:57:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -40,6 +40,12 @@ #define TOAST_TUPLE_TARGET (MaxTupleSize / 4) +/* + * If an index value is larger than TOAST_INDEX_TARGET, we will try to + * compress it (we can't move it out-of-line, however). Note that this + * number is per-datum, not per-tuple, for simplicity in index_formtuple(). + */ +#define TOAST_INDEX_TARGET (MaxTupleSize / 16) /* * When we store an oversize datum externally, we divide it into chunks @@ -95,6 +101,14 @@ extern varattrib *heap_tuple_fetch_attr(varattrib * attr); */ extern varattrib *heap_tuple_untoast_attr(varattrib * attr); +/* ---------- + * toast_compress_datum - + * + * Create a compressed version of a varlena datum, if possible + * ---------- + */ +extern Datum toast_compress_datum(Datum value); + #endif /* TUPLE_TOASTER_ACTIVE */ |