Peter Geoghegan <pg@bowt.ie> writes:
> On Thu, Jul 11, 2019 at 2:20 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> As far as I can tell, no special finagling is needed: if we just use
>> the regular index-only-scan logic then this all works the way we want,
>> and it's actually better than before because we get to skip heap visits
>> altogether when dealing with unchanging data. Attached is a patch
>> against HEAD that seems to do all the right things.
> Interesting approach. I certainly prefer it to the alternative
> approach of framing the problem as a visibility concern.
Yes, I certainly like this better than my previous attempt.
I still feel like we're going to want to push (most of?) this logic
below the tableam API at some point, because its implementation was
and remains tied to heap+btree. But other table AMs are likely to
support ordered scan accesses of some sort, and they're going to
want to be able to adjust the planner's extremal-value estimates
too. It's a job for later though.
regards, tom lane