Re: Dead code in toast_fetch_datum_slice? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Dead code in toast_fetch_datum_slice?
Date
Msg-id 20181210182319.xoyi2w7ftpk35qkm@alvherre.pgsql
Whole thread Raw
In response to Re: Dead code in toast_fetch_datum_slice?  (Paul Ramsey <pramsey@cleverelephant.ca>)
Responses Re: Dead code in toast_fetch_datum_slice?  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
On 2018-Dec-10, Paul Ramsey wrote:

> Your analysis looks correct to me, I'm pretty sure I had the same reaction,
> first time I read through. It would be nice to handle partial decompression
> all the way down at this level, but unfortunately the comment at the
> Assert() is right: there's no way to know how many of the toasted pieces
> need to be read in order to have enough compressed input to create the
> desired amount of decompressed output, so there's no choice except to read
> the whole compressed thing, even in a slicing context.

It'd be useful to have some sort of iterator-style API for detoasting.
If you need more data, just call it again.  It's more wasteful if you
end up retrieving all of the toasted data, but if you just need a
fraction it's obviously a win.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [HACKERS] Bug when dumping "empty" operator classes
Next
From: Stephen Frost
Date:
Subject: Re: Dead code in toast_fetch_datum_slice?