From 4d0e994eed83c845a05da6e9a417b4efec67efaf Mon Sep 17 00:00:00 2001 From: Stephen Frost Date: Tue, 2 Apr 2019 12:35:32 -0400 Subject: Add support for partial TOAST decompression When asked for a slice of a TOAST entry, decompress enough to return the slice instead of decompressing the entire object. For use cases where the slice is at, or near, the beginning of the entry, this avoids a lot of unnecessary decompression work. This changes the signature of pglz_decompress() by adding a boolean to indicate if it's ok for the call to finish before consuming all of the source or destination buffers. Author: Paul Ramsey Reviewed-By: Rafia Sabih, Darafei Praliaskouski, Regina Obe Discussion: https://postgr.es/m/CACowWR07EDm7Y4m2kbhN_jnys%3DBBf9A6768RyQdKm_%3DNpkcaWg%40mail.gmail.com --- src/include/common/pg_lzcompress.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/include/common') diff --git a/src/include/common/pg_lzcompress.h b/src/include/common/pg_lzcompress.h index d4b2e8a53c6..279b66ec7c3 100644 --- a/src/include/common/pg_lzcompress.h +++ b/src/include/common/pg_lzcompress.h @@ -86,6 +86,6 @@ extern const PGLZ_Strategy *const PGLZ_strategy_always; extern int32 pglz_compress(const char *source, int32 slen, char *dest, const PGLZ_Strategy *strategy); extern int32 pglz_decompress(const char *source, int32 slen, char *dest, - int32 rawsize); + int32 rawsize, bool check_complete); #endif /* _PG_LZCOMPRESS_H_ */ -- cgit v1.2.3