1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-29 22:49:41 +03:00

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.
This commit is contained in:
Tom Lane
2001-02-15 20:57:01 +00:00
parent 5341cddba8
commit 059e361481
3 changed files with 54 additions and 22 deletions

View File

@@ -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 */