pgsql: Support GiST index support functions that want to cache data acr

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Support GiST index support functions that want to cache data acr
Date: 2011-09-30 23:49:11
Message-ID: E1R9mpL-00062S-NB@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d22a09dc70f9830fa78c1cd1a3a453e4e473d354

Modified Files
--------------
doc/src/sgml/gist.sgml | 46 ++++++++++-----
src/backend/access/gist/gist.c | 72 ++++++++++++++++--------
src/backend/access/gist/gistbuild.c | 42 +++++++-------
src/backend/access/gist/gistget.c | 4 +-
src/backend/access/gist/gistscan.c | 107 +++++++++++++++++++++++++++++-----
src/include/access/gist_private.h | 17 ++++-
6 files changed, 206 insertions(+), 82 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-10-01 03:55:10 pgsql: Cache the result of makesign() across calls of gtrgm_penalty().
Previous Message Tom Lane 2011-09-29 22:13:57 pgsql: Fix recursion into previously planned sub-query in examine_simpl