Re: GSoC proposal. Index-only scans for GIST

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Anastasia Lubennikova <lubennikovaav(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GSoC proposal. Index-only scans for GIST
Date: 2014-03-18 19:08:49
Message-ID: CAPpHfdsHNxYxEue+5bNJXu8JR2HD9iA4Pu71J3ozemSdvNuJeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 18, 2014 at 5:12 PM, Anastasia Lubennikova <
lubennikovaav(at)gmail(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-03-18 19:10:26 Re: Portability issues in shm_mq
Previous Message Greg Stark 2014-03-18 19:05:07 Re: Wiki Page Draft for upcoming release