pgsql: This patch makes some improvements to the rtree index

From: neilc(at)svr1(dot)postgresql(dot)org (Neil Conway)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: This patch makes some improvements to the rtree index
Date: 2005-01-18 23:26:04
Message-ID: 20050118232604.0063B3A2BC7@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
This patch makes some improvements to the rtree index implementation:

(1) Keep a pin on the scan's current buffer and mark buffer. This
avoids the need to do a ReadBuffer() for each tuple produced by the
scan. Since ReadBuffer() is expensive, this is a significant win.

(2) Convert a ReleaseBuffer(); ReadBuffer() pair into
ReleaseAndReadBuffer(). Surely not a huge win, but it saves a lock
acquire/release...

(3) Remove a bunch of duplicated code in rtget.c; make rtnext() handle
both the "initial result" and "subsequent result" cases.

(4) Add support for index tuple killing

(5) Remove rtscancache(): it is dead code, for the same reason that
gistscancache() is dead code (an index scan ought not be invoked with
NoMovementScanDirection).

The end result is about a 10% improvement in rtree index scan perf,
according to contrib/rtree_gist/bench.

Modified Files:
--------------
pgsql/src/backend/access/rtree:
rtget.c (r1.33 -> r1.34)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/rtree/rtget.c.diff?r1=1.33&r2=1.34)
rtree.c (r1.85 -> r1.86)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/rtree/rtree.c.diff?r1=1.85&r2=1.86)
rtscan.c (r1.56 -> r1.57)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/rtree/rtscan.c.diff?r1=1.56&r2=1.57)
pgsql/src/include/access:
rtree.h (r1.36 -> r1.37)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/rtree.h.diff?r1=1.36&r2=1.37)

Browse pgsql-committers by date

  From Date Subject
Next Message User Andrewd 2005-01-18 23:47:40 pgbuildfarm - client-code: - sanity checks for running as root and
Previous Message Neil Conway 2005-01-18 22:59:37 pgsql: Replace the use of "0" with "NULL" where appropriate in dllist.c,