diff options
author | Stephen Frost <sfrost@snowman.net> | 2019-04-02 12:35:32 -0400 |
---|---|---|
committer | Stephen Frost <sfrost@snowman.net> | 2019-04-02 12:35:32 -0400 |
commit | 4d0e994eed83c845a05da6e9a417b4efec67efaf (patch) | |
tree | 448059e04754de5146098545e7e414a9612c7348 /src/backend/access/transam/xlogreader.c | |
parent | d50d172e517c1d2aabff3ceb3ad3113b909c5017 (diff) | |
download | postgresql-4d0e994eed83c845a05da6e9a417b4efec67efaf.tar.gz postgresql-4d0e994eed83c845a05da6e9a417b4efec67efaf.zip |
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
Diffstat (limited to 'src/backend/access/transam/xlogreader.c')
-rw-r--r-- | src/backend/access/transam/xlogreader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c index cbc7e4e7ead..9196aa3aaef 100644 --- a/src/backend/access/transam/xlogreader.c +++ b/src/backend/access/transam/xlogreader.c @@ -1425,7 +1425,7 @@ RestoreBlockImage(XLogReaderState *record, uint8 block_id, char *page) { /* If a backup block image is compressed, decompress it */ if (pglz_decompress(ptr, bkpb->bimg_len, tmp.data, - BLCKSZ - bkpb->hole_length) < 0) + BLCKSZ - bkpb->hole_length, true) < 0) { report_invalid_record(record, "invalid compressed image at %X/%X, block %d", (uint32) (record->ReadRecPtr >> 32), |