postgresql/src/backend/access
Tomas Vondra 11a078cf87 Optimize partial TOAST decompression
Commit 4d0e994eed added support for partial TOAST decompression, so the
decompression is interrupted after producing the requested prefix. For
prefix and slices near the beginning of the entry, this may saves a lot
of decompression work.

That however only deals with decompression - the whole compressed entry
was still fetched and re-assembled, even though the compression used
only a small fraction of it. This commit improves that by computing how
much compressed data may be needed to decompress the requested prefix,
and then fetches only the necessary part.

We always need to fetch a bit more compressed data than the requested
(uncompressed) prefix, because the prefix may not be compressible at all
and pglz itself adds a bit of overhead. That means this optimization is
most effective when the requested prefix is much smaller than the whole
compressed entry.

Author: Binguo Bao
Reviewed-by: Andrey Borodin, Tomas Vondra, Paul Ramsey
Discussion: https://www.postgresql.org/message-id/flat/CAL-OGkthU9Gs7TZchf5OWaL-Gsi=hXqufTxKv9qpNG73d5na_g@mail.gmail.com
2019-10-01 14:28:28 +02:00
..
brin Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
common Optimize partial TOAST decompression 2019-10-01 14:28:28 +02:00
gin Fix overflow check and comment in GIN posting list encoding. 2019-08-28 12:55:33 +03:00
gist Support reloptions of enum type 2019-09-25 15:56:52 -03:00
hash Fix inconsistencies and typos in the tree, take 10 2019-08-13 13:53:41 +09:00
heap Speedup truncations of relation forks. 2019-09-24 17:31:26 +09:00
index Fix freeing old values in index_store_float8_orderby_distances() 2019-09-20 01:19:08 +03:00
nbtree Remove redundant _bt_truncate() comment paragraph. 2019-09-12 09:51:27 -07:00
rmgrdesc Fix nbtree page split rmgr desc routine. 2019-09-12 15:45:08 -07:00
spgist Fix bug in pairingheap_SpGistSearchItem_cmp() 2019-09-25 01:47:36 +03:00
table Create an API for inserting and deleting rows in TOAST tables. 2019-09-06 10:38:51 -04:00
tablesample Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
transam Make crash recovery ignore recovery target settings. 2019-09-30 10:18:15 +09:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00