Teach SP-GiST to do index-only scans.
Tom Lane <tgl@sss.pgh.pa.us>
Teach SP-GiST to do index-only scans. Operator classes can specify whether or not they support this; this preserves the flexibility to use lossy representations within an index. In passing, move constant data about a given index into the rd_amcache cache area, instead of doing fresh lookups each time we start an index operation. This is mainly to try to make sure that spgcanreturn() has insignificant cost; I still don't have any proof that it matters for actual index accesses. Also, get rid of useless copying of FmgrInfo pointers; we can perfectly well use the relcache's versions in-place.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/spgist.sgml | modified | +15 −0 |
| src/backend/access/spgist/spgdoinsert.c | modified | +7 −2 |
| src/backend/access/spgist/spgkdtreeproc.c | modified | +1 −0 |
| src/backend/access/spgist/spgquadtreeproc.c | modified | +4 −0 |
| src/backend/access/spgist/spgscan.c | modified | +81 −16 |
| src/backend/access/spgist/spgtextproc.c | modified | +11 −2 |
| src/backend/access/spgist/spgutils.c | modified | +82 −84 |
| src/include/access/spgist.h | modified | +4 −0 |
| src/include/access/spgist_private.h | modified | +22 −9 |
| src/test/regress/expected/create_index.out | modified | +59 −59 |