Re: GSoC proposal. Index-only scans for GIST - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: GSoC proposal. Index-only scans for GIST
Date
Msg-id CAPpHfdsHNxYxEue+5bNJXu8JR2HD9iA4Pu71J3ozemSdvNuJeg@mail.gmail.com
Whole thread Raw
In response to GSoC proposal. Index-only scans for GIST  (Anastasia Lubennikova <lubennikovaav@gmail.com>)
List pgsql-hackers
On Tue, Mar 18, 2014 at 5:12 PM, Anastasia Lubennikova <lubennikovaav@gmail.com> wrote:

2. gistget algorithm (several parts omitted):

Check the key
gistindex_keytest() – does this index tuple satisfy the scan key(s)?

Scan all items on the GiST index page and insert them into the queue (or directly to output areas)

plain scan

Heap tuple TIDs are returned into so->pageData[]

ordered scan

Heap tuple TIDs are pushed into individual search queue items

If the fetch() is specified by the developer, then using it, algorithm can retrieve the data directly to output areas at this stage, without reference to the heap.


I think there are following changes to be made to GiST code:
1) When next consistent IndexTuple is found extract original Datums using "fetch" method.
2) Put those original Datums to queue.
3) When returning next ItemPointer from queue put original Datums to IndexScanDesc (into xs_itup).

3. Create function gistcanreturn to check whether fetch() is specified by user.

Amcanreturn – Function to check whether index supports index-only scans, or zero if none

There is the question of support index-only scans for multicolumn indexes. Probably it would require extend the interface to add separate columns checking.

To solve this question I need the community’s help.


4. Add details for index only scans into gistcostestimate function


Also, another part of work to be mentioned is to implement fetch function for all suitable opclasses.

----
With best regards,
Alexander Korotkov.

pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Wiki Page Draft for upcoming release
Next
From: Robert Haas
Date:
Subject: Re: Portability issues in shm_mq