Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA15335; Tue, 16 Jul 91 12:50:10 -0700
Message-Id: <9107161950.AA15335@postgres.Berkeley.EDU>
From: mao@postgres.Berkeley.EDU (Mike Olson)
Subject: Re: Access methods
To: postgres@postgres.berkeley.edu
In-Reply-To: Your message of "Tue, 16 Jul 91 12:33:55 PST."
             <9107161933.AA15084@postgres.Berkeley.EDU> 
Date: Tue, 16 Jul 91 12:42:21 PDT

> I would like to write my own access method (another variant of the R-tree,
> for example). Any suggestions?

do you just want to add new data types to the rtree access method, or do
you really want to do a new storage structure?  postgres permits both, though
the former is by some distance easier than the latter.

if you just want to store new kinds of rectangles (n-dimensional, floating
point, strings as coordinates, etc) in conventional rtrees, you only need
to define a new operator class.  this requires you to write three or four
routines.

if you want to use a new storage structure, you need to understand the
postgres buffer manager interface.  you will probably need to link your
code directly into the postgres backend, rather than load it dynamically.
in addition, you'll need to understand some important postgres internal
abstractions -- scans, qualifications, strategy maps, etc.  there are
twelve or so public interface routines you're required to provide.

if this is what you want to do, i suggest beginning with the new btree code
(i'm pretty sure we shipped this in release 2.1), or the rtree code, and
asking questions about the things you don't understand.  we'll be happy to
answer them.
					mike olson
					postgres research group
					uc berkeley
					mao@postgres.berkeley.edu
