Re: proposal: be smarter about i/o patterns in index scan - Mailing list pgsql-hackers

From Tom Lane
Subject Re: proposal: be smarter about i/o patterns in index scan
Date
Msg-id 20357.1084998680@sss.pgh.pa.us
Whole thread Raw
In response to Re: proposal: be smarter about i/o patterns in index scan  ("Jeffrey W. Baker" <jwbaker@acm.org>)
List pgsql-hackers
"Jeffrey W. Baker" <jwbaker@acm.org> writes:
> No doubt, you can't just naively create giant vectors of TIDs and expect
> to sort them.  Is there any concept in Pg of an unrealized result?

Only for the case of a partially-read plan result.  That is, we do this
for rowsets, but not for scalars or arrays.  A lot of the point of the
LIMIT 1 example is that it is exploiting the fact that we won't ever
materialize the full output of the indexscan.

> If you scanned an index building up a result set that was totally
> unrealized, except for the TID and the index columns, you could
> cheaply join two such results without ever touching the heap.  You
> could also use the existing Sort execution step to sort such a result.
> Then don't touch the heap something accesses a non-index column, or
> because you are returning the result somewhere and need to satisfy
> MVCC visibility limits.

This is basically what I was talking about with IndexOnlyScan/TidExpand.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Jeffrey W. Baker"
Date:
Subject: Re: proposal: be smarter about i/o patterns in index scan
Next
From: Greg Stark
Date:
Subject: Re: proposal: be smarter about i/o patterns in index scan