Skip site navigation (1) Skip section navigation (2)

rtree: improve performance, tuple killing

From: Neil Conway <neilc(at)samurai(dot)com>
To: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: rtree: improve performance, tuple killing
Date: 2004-11-24 00:15:38
Message-ID: 1101255338.12045.13.camel@localhost.localdomain (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
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.

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

(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

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

These changes (with the exception of #2) are analogous to changes I've
already made for GiST (it's clear that GiST was started as a fork of
rtree). I'm not hugely interested in further improvements to rtree; I
just did this stuff because it is low-hanging fruit and I've already
made the same changes for GiST.


Attachment: rtree_perf_work-2.patch
Description: text/x-patch (12.6 KB)


pgsql-patches by date

Next:From: Neil ConwayDate: 2004-11-24 00:18:28
Subject: minor bufmgr cleanup
Previous:From: Neil ConwayDate: 2004-11-23 23:59:07
Subject: Re: pgcrypto: Makefile check

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group