Subject: Access methods

From: Walid Aref <[email-masked]>
Date: Tue, 16 Jul 91 12:33:55 -0700

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

---

From: [email-masked] (Mike Olson)
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
					[email-masked]