Re: [HACKERS] SP-GiST versus index-only scans

2012-01-08 Thread Tom Lane
Stefan Keller writes: > There seems to exist some opportunities now with GIST which relate to > geometry/geography types (but not only...): > 1. Index-only scans on geometry columns with SP-GIST (being able to do > a "SELECT id FROM my_table WHERE mygeom...;"). Well, if somebody builds an SP-GiST

Re: [HACKERS] SP-GiST versus index-only scans

2012-01-08 Thread Stefan Keller
Tom, There seems to exist some opportunities now with GIST which relate to geometry/geography types (but not only...): 1. Index-only scans on geometry columns with SP-GIST (being able to do a "SELECT id FROM my_table WHERE mygeom...;"). 2. Index clustering incuding NULL values (i.e. being able to d

Re: [HACKERS] SP-GiST versus index-only scans

2011-12-14 Thread Tom Lane
Jesper Krogh writes: > On 2011-12-14 19:48, Tom Lane wrote: >> I think this is somewhat wishful thinking unfortunately. The difficulty >> is that if the index isn't capable of reconstructing the original value, >> then it's probably giving only an approximate (lossy) answer, which >> means we'll

Re: [HACKERS] SP-GiST versus index-only scans

2011-12-14 Thread Jesper Krogh
On 2011-12-14 19:48, Tom Lane wrote: Jesper Krogh writes: On 2011-12-14 19:00, Tom Lane wrote: So the problem is that we have to either disallow such opclass designs, or support per-opclass rather than per-index-AM decisions about whether index-only scans are possible. Just a quick comment, f

Re: [HACKERS] SP-GiST versus index-only scans

2011-12-14 Thread Tom Lane
Jesper Krogh writes: > On 2011-12-14 19:00, Tom Lane wrote: >> So the problem is that we have to either disallow such opclass designs, >> or support per-opclass rather than per-index-AM decisions about whether >> index-only scans are possible. > Just a quick comment, for some queries like the fam

Re: [HACKERS] SP-GiST versus index-only scans

2011-12-14 Thread Jesper Krogh
On 2011-12-14 19:00, Tom Lane wrote: So the problem is that we have to either disallow such opclass designs, or support per-opclass rather than per-index-AM decisions about whether index-only scans are possible. Just a quick comment, for some queries like the famous select count(*) from table w

[HACKERS] SP-GiST versus index-only scans

2011-12-14 Thread Tom Lane
It would not take very much at all to make the SP-GiST stuff support index-only scans, except for one thing: it's conceivable that an opclass might choose to store only a lossy version of the original indexed datum, in which case it'd not be able to reconstruct the datum on demand. I'm not sure ho