]> granicus.if.org Git - postgresql/commit
Add support for partial TOAST decompression
authorStephen Frost <sfrost@snowman.net>
Tue, 2 Apr 2019 16:35:32 +0000 (12:35 -0400)
committerStephen Frost <sfrost@snowman.net>
Tue, 2 Apr 2019 16:35:32 +0000 (12:35 -0400)
commit4d0e994eed83c845a05da6e9a417b4efec67efaf
tree448059e04754de5146098545e7e414a9612c7348
parentd50d172e517c1d2aabff3ceb3ad3113b909c5017
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/backend/access/heap/tuptoaster.c
src/backend/access/transam/xlogreader.c
src/backend/utils/adt/varlena.c
src/common/pg_lzcompress.c
src/include/common/pg_lzcompress.h