]> granicus.if.org Git - postgresql/commit
Support GiST index support functions that want to cache data across calls.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Sep 2011 23:48:57 +0000 (19:48 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Sep 2011 23:48:57 +0000 (19:48 -0400)
commitd22a09dc70f9830fa78c1cd1a3a453e4e473d354
tree0867ec67a9643663d27f90ef8df2d58cb6cd9c3a
parent79edb2b1dc33166b576f51a8255a7614f748d9c9
Support GiST index support functions that want to cache data across calls.

pg_trgm was already doing this unofficially, but the implementation hadn't
been thought through very well and leaked memory.  Restructure the core
GiST code so that it actually works, and document it.  Ordinarily this
would have required an extra memory context creation/destruction for each
GiST index search, but I was able to avoid that in the normal case of a
non-rescanned search by finessing the handling of the RBTree.  It used to
have its own context always, but now shares a context with the
scan-lifespan data structures, unless there is more than one rescan call.
This should make the added overhead unnoticeable in typical cases.
doc/src/sgml/gist.sgml
src/backend/access/gist/gist.c
src/backend/access/gist/gistbuild.c
src/backend/access/gist/gistget.c
src/backend/access/gist/gistscan.c
src/include/access/gist_private.h