Index-only scans for GIST

Lists: pgsql-hackers
From: Anastasia Lubennikova <lubennikovaav(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Index-only scans for GIST
Date: 2014-05-25 10:12:26
Message-ID: CAP4vRV55D9+Ou_TSnEDrD-TURMiPGT4AbFh_m5dZDkBSb07hkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi, hackers!
There are first results of my work on GSoC project "Index-only scans for
GIST".

1. Version of my project code is in forked repository
https://github.com/lubennikovaav/postgres/tree/indexonlygist2
Patch is in attachments
- This version is only for one-column indexes
- fetch() method is realized only for box opclass (because it's trivial)

2. I test Index-only scans with SQL script box_test.sql
and it works really faster. (results in box_test_out)

I'll be glad to get your feedback about this feature.

--
Best regards,
Lubennikova Anastasia

Attachment Content-Type Size
indexonlygist_2.0.patch application/octet-stream 19.4 KB
box_test.sql application/octet-stream 1.2 KB
box_test_out.out application/octet-stream 5.8 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Anastasia Lubennikova <lubennikovaav(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index-only scans for GIST
Date: 2014-05-29 20:07:35
Message-ID: CA+TgmoZvvU6ChT3dSMX6ksBHO2iCa+5tCTZ2_gKSS_hQEPgs7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, May 25, 2014 at 6:12 AM, Anastasia Lubennikova
<lubennikovaav(at)gmail(dot)com> wrote:
> Hi, hackers!
> There are first results of my work on GSoC project "Index-only scans for
> GIST".

Cool.

> 1. Version of my project code is in forked repository
> https://github.com/lubennikovaav/postgres/tree/indexonlygist2
> Patch is in attachments
> - This version is only for one-column indexes

That's probably a limitation that needs to be fixed before this can be
committed.

> - fetch() method is realized only for box opclass (because it's trivial)

That might not need to be fixed before this can be committed.

> 2. I test Index-only scans with SQL script box_test.sql
> and it works really faster. (results in box_test_out)
>
> I'll be glad to get your feedback about this feature.

Since this is a GSoC project, it would be nice if one of the people
who is knowledgeable about GIST (Heikki, Alexander, etc.) could weigh
in on this before too much time goes by, so that Anastasia can press
forward with this work.

I don't know enough to offer too many substantive comments, but I
think you should remove all of the //-style comments (most of which
are debugging leftovers) and add some more comments describing what
you're actually doing and, more importantly, why.

This comment doesn't appear to make sense:

+ /*
+ * The offset number on tuples on internal pages is unused.
For historical
+ * reasons, it is set 0xffff.
+ */

The reason this doesn't make sense is because the tuple in question is
not on an internal page, or indeed any page at all.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company