pgsql: Add support for partial TOAST decompression

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add support for partial TOAST decompression
Date: 2019-04-02 16:36:33
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

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



Modified Files
src/backend/access/heap/tuptoaster.c | 38 +++++++++++++++++++++++++++--
src/backend/access/transam/xlogreader.c | 2 +-
src/backend/utils/adt/varlena.c | 22 ++++++++++-------
src/common/pg_lzcompress.c | 42 +++++++++++++++------------------
src/include/common/pg_lzcompress.h | 2 +-
5 files changed, 70 insertions(+), 36 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2019-04-02 18:23:39 pgsql: Report progress of CREATE INDEX operations
Previous Message Etsuro Fujita 2019-04-02 11:33:33 pgsql: postgres_fdw: Perform the (FINAL, NULL) upperrel operations remo